From e22ba227a694b8426e69dbce640c5b0e4f39f574 Mon Sep 17 00:00:00 2001 From: Sam Stephenson Date: Wed, 7 Feb 2018 12:43:36 -0600 Subject: Initial commit --- .gitattributes | 2 + .gitignore | 2 + Gemfile | 8 +++ Gemfile.lock | 135 +++++++++++++++++++++++++++++++++++++ LICENSE | 21 ++++++ README.md | 1 + activetext.gemspec | 20 ++++++ app/javascript/activetext/index.js | 1 + app/models/active_text/document.rb | 4 ++ lib/active_text.rb | 5 ++ lib/active_text/engine.rb | 7 ++ package.json | 20 ++++++ test/test_helper.rb | 4 ++ yarn.lock | 7 ++ 14 files changed, 237 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 Gemfile create mode 100644 Gemfile.lock create mode 100644 LICENSE create mode 100644 README.md create mode 100644 activetext.gemspec create mode 100644 app/javascript/activetext/index.js create mode 100644 app/models/active_text/document.rb create mode 100644 lib/active_text.rb create mode 100644 lib/active_text/engine.rb create mode 100644 package.json create mode 100644 test/test_helper.rb create mode 100644 yarn.lock diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000000..dfe0770424 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# Auto detect text files and perform LF normalization +* text=auto diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000..4d64059f69 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/node_modules + diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000000..7a50773bb3 --- /dev/null +++ b/Gemfile @@ -0,0 +1,8 @@ +source "https://rubygems.org" + +git_source(:github) { |repo_path| "https://github.com/#{repo_path}.git" } + +gemspec + +gem "rails", github: "rails/rails" +gem "rake" diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000000..d6f040c0e8 --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,135 @@ +GIT + remote: https://github.com/rails/rails.git + revision: c5d431e469505ec4438f9fd37530dd9c79c8a872 + specs: + actioncable (6.0.0.alpha) + actionpack (= 6.0.0.alpha) + nio4r (~> 2.0) + websocket-driver (>= 0.6.1) + actionmailer (6.0.0.alpha) + actionpack (= 6.0.0.alpha) + actionview (= 6.0.0.alpha) + activejob (= 6.0.0.alpha) + mail (~> 2.5, >= 2.5.4) + rails-dom-testing (~> 2.0) + actionpack (6.0.0.alpha) + actionview (= 6.0.0.alpha) + activesupport (= 6.0.0.alpha) + rack (~> 2.0) + rack-test (>= 0.6.3) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.0, >= 1.0.2) + actionview (6.0.0.alpha) + activesupport (= 6.0.0.alpha) + builder (~> 3.1) + erubi (~> 1.4) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.0, >= 1.0.3) + activejob (6.0.0.alpha) + activesupport (= 6.0.0.alpha) + globalid (>= 0.3.6) + activemodel (6.0.0.alpha) + activesupport (= 6.0.0.alpha) + activerecord (6.0.0.alpha) + activemodel (= 6.0.0.alpha) + activesupport (= 6.0.0.alpha) + arel (>= 9.0) + activestorage (6.0.0.alpha) + actionpack (= 6.0.0.alpha) + activerecord (= 6.0.0.alpha) + marcel (~> 0.3.1) + activesupport (6.0.0.alpha) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (~> 0.7) + minitest (~> 5.1) + tzinfo (~> 1.1) + rails (6.0.0.alpha) + actioncable (= 6.0.0.alpha) + actionmailer (= 6.0.0.alpha) + actionpack (= 6.0.0.alpha) + actionview (= 6.0.0.alpha) + activejob (= 6.0.0.alpha) + activemodel (= 6.0.0.alpha) + activerecord (= 6.0.0.alpha) + activestorage (= 6.0.0.alpha) + activesupport (= 6.0.0.alpha) + bundler (>= 1.3.0) + railties (= 6.0.0.alpha) + sprockets-rails (>= 2.0.0) + railties (6.0.0.alpha) + actionpack (= 6.0.0.alpha) + activesupport (= 6.0.0.alpha) + method_source + rake (>= 0.8.7) + thor (>= 0.18.1, < 2.0) + +PATH + remote: . + specs: + activetext (0.1) + activerecord (>= 5.2.0) + activestorage (>= 5.2.0) + rails (>= 5.2.0) + +GEM + remote: https://rubygems.org/ + specs: + arel (9.0.0) + builder (3.2.3) + concurrent-ruby (1.0.5) + crass (1.0.3) + erubi (1.7.0) + globalid (0.4.1) + activesupport (>= 4.2.0) + i18n (0.9.3) + concurrent-ruby (~> 1.0) + loofah (2.1.1) + crass (~> 1.0.2) + nokogiri (>= 1.5.9) + mail (2.7.0) + mini_mime (>= 0.1.1) + marcel (0.3.1) + mimemagic (~> 0.3.2) + method_source (0.9.0) + mimemagic (0.3.2) + mini_mime (1.0.0) + mini_portile2 (2.3.0) + minitest (5.11.3) + nio4r (2.2.0) + nokogiri (1.8.2) + mini_portile2 (~> 2.3.0) + rack (2.0.4) + rack-test (0.8.2) + rack (>= 1.0, < 3) + rails-dom-testing (2.0.3) + activesupport (>= 4.2.0) + nokogiri (>= 1.6) + rails-html-sanitizer (1.0.3) + loofah (~> 2.0) + rake (12.3.0) + sprockets (3.7.1) + concurrent-ruby (~> 1.0) + rack (> 1, < 3) + sprockets-rails (3.2.1) + actionpack (>= 4.0) + activesupport (>= 4.0) + sprockets (>= 3.0.0) + thor (0.20.0) + thread_safe (0.3.6) + tzinfo (1.2.5) + thread_safe (~> 0.1) + websocket-driver (0.7.0) + websocket-extensions (>= 0.1.0) + websocket-extensions (0.1.3) + +PLATFORMS + ruby + +DEPENDENCIES + activetext! + bundler (~> 1.15) + rails! + rake + +BUNDLED WITH + 1.16.1 diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000000..4a5fe6361d --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2018 Basecamp, LLC + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000000..07e2238c34 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +# activetext diff --git a/activetext.gemspec b/activetext.gemspec new file mode 100644 index 0000000000..9f5e611f2f --- /dev/null +++ b/activetext.gemspec @@ -0,0 +1,20 @@ +Gem::Specification.new do |s| + s.name = "activetext" + s.version = "0.1" + s.authors = ["Javan Makhmali", "Sam Stephenson"] + s.email = ["javan@javan.us", "sstephenson@gmail.com"] + s.summary = "Edit and display rich text in Rails applications" + s.homepage = "https://github.com/basecamp/activetext" + s.license = "MIT" + + s.required_ruby_version = ">= 2.2.2" + + s.add_dependency "rails", ">= 5.2.0" + s.add_dependency "activerecord", ">= 5.2.0" + s.add_dependency "activestorage", ">= 5.2.0" + + s.add_development_dependency "bundler", "~> 1.15" + + s.files = `git ls-files`.split("\n") + s.test_files = `git ls-files -- test/*`.split("\n") +end diff --git a/app/javascript/activetext/index.js b/app/javascript/activetext/index.js new file mode 100644 index 0000000000..c77ed0ab26 --- /dev/null +++ b/app/javascript/activetext/index.js @@ -0,0 +1 @@ +import * as Trix from "trix" diff --git a/app/models/active_text/document.rb b/app/models/active_text/document.rb new file mode 100644 index 0000000000..74b1ddc746 --- /dev/null +++ b/app/models/active_text/document.rb @@ -0,0 +1,4 @@ +module ActiveText + class Document < ActiveRecord::Base + end +end diff --git a/lib/active_text.rb b/lib/active_text.rb new file mode 100644 index 0000000000..e6384020f1 --- /dev/null +++ b/lib/active_text.rb @@ -0,0 +1,5 @@ +require "active_record" +require "active_text/engine" + +module ActiveText +end diff --git a/lib/active_text/engine.rb b/lib/active_text/engine.rb new file mode 100644 index 0000000000..28383672f4 --- /dev/null +++ b/lib/active_text/engine.rb @@ -0,0 +1,7 @@ +require "rails/engine" + +module ActiveText + class Engine < Rails::Engine + config.eager_load_namespaces << ActiveText + end +end diff --git a/package.json b/package.json new file mode 100644 index 0000000000..7f0c79a054 --- /dev/null +++ b/package.json @@ -0,0 +1,20 @@ +{ + "name": "activetext", + "version": "0.1", + "description": "Edit and display rich text in Rails applications", + "main": "app/javascript/activetext/index.js", + "files": [ + "app/javascript/activetext/*.js" + ], + "repository": "https://github.com/basecamp/activetext", + "author": "Basecamp, LLC", + "contributors": [ + "Javan Makhmali ", + "Sam Stephenson " + ], + "license": "MIT", + "dependencies": { + "trix": "^0.11.1" + }, + "private": true +} diff --git a/test/test_helper.rb b/test/test_helper.rb new file mode 100644 index 0000000000..7ea27bb507 --- /dev/null +++ b/test/test_helper.rb @@ -0,0 +1,4 @@ +require "bundler/setup" +require "active_support" +require "active_support/test_case" +require "active_support/testing/autorun" diff --git a/yarn.lock b/yarn.lock new file mode 100644 index 0000000000..fbaef41eaa --- /dev/null +++ b/yarn.lock @@ -0,0 +1,7 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +trix@^0.11.1: + version "0.11.1" + resolved "https://registry.yarnpkg.com/trix/-/trix-0.11.1.tgz#ffe54f2757c2c2385b8424fd5c5d2ab712a09acc" -- cgit v1.2.3