crt 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: ca64ba18bf58db941d477f33b2b227d94b6d9d1f
4
+ data.tar.gz: 66c9b49496e41caba2cd7d78c3e9d493270d3c27
5
+ SHA512:
6
+ metadata.gz: 5c91aceeb5942e977e3c01dab7a90aac63c283633878e89f709831ce11e99919c5f38d07db12cce43e9293027b4fda77e5d0f12cd474eb79e40530073843052a
7
+ data.tar.gz: fe291963fa373ccbf6c291d2cae8afdd72cf31e9471333fdbbe245fc98b49dff0bdacaa49371495312f7f9a66a92763838fc646d21f960dd83ee4c8fdaf2ac6b
data/.gitignore ADDED
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
data/.travis.yml ADDED
@@ -0,0 +1,4 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.2.3
4
+ before_install: gem install bundler -v 1.10.6
@@ -0,0 +1,13 @@
1
+ # Contributor Code of Conduct
2
+
3
+ As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
4
+
5
+ We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion.
6
+
7
+ Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
8
+
9
+ Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
10
+
11
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
12
+
13
+ This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in crt.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 monlu
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,41 @@
1
+ # Crt
2
+
3
+ Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/crt`. To experiment with that code, run `bin/console` for an interactive prompt.
4
+
5
+ TODO: Delete this and the text above, and describe your gem
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'crt'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install crt
22
+
23
+ ## Usage
24
+
25
+ TODO: Write usage instructions here
26
+
27
+ ## Development
28
+
29
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake false` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
30
+
31
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
+
33
+ ## Contributing
34
+
35
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/crt. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.
36
+
37
+
38
+ ## License
39
+
40
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
41
+
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require 'bundler/setup'
2
+ require "bundler/gem_tasks"
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "crt"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start
data/bin/crt ADDED
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env ruby
2
+ require 'pathname'
3
+
4
+ source_path = (Pathname.new(__FILE__).dirname + '../lib').expand_path
5
+ $LOAD_PATH << source_path
6
+
7
+ require 'crt'
8
+ require 'pry'
9
+
10
+ templates_root = File.expand_path(File.join("..", "templates"), File.dirname(__FILE__))
11
+ Crt::CrtGenerator.source_root templates_root
12
+ Crt::CrtGenerator.source_paths << Rails::Generators::AppGenerator.source_root << templates_root
13
+
14
+ # binding.pry
15
+ Crt::CrtGenerator.start
data/bin/setup ADDED
@@ -0,0 +1,7 @@
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+
5
+ bundle install
6
+
7
+ # Do any other automated setup that you need to do here
data/crt.gemspec ADDED
@@ -0,0 +1,25 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'crt/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "crt"
8
+ spec.version = Crt::VERSION
9
+ spec.authors = ["monlu"]
10
+ spec.email = ["glu@canvas.is"]
11
+
12
+ spec.summary = %q{Canvas Rails Template}
13
+ spec.description = %q{Prototype of Canvas Rails Template}
14
+ spec.homepage = "https://github.com/monlu/crt"
15
+ spec.license = "MIT"
16
+
17
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
18
+ spec.executables = ['crt']
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_dependency 'rails', Crt::RAILS_VERSION
22
+ spec.add_dependency "bundler", "~> 1.10"
23
+ spec.add_development_dependency "rake", "~> 10.0"
24
+ spec.add_development_dependency "pry", "~> 0.10"
25
+ end
@@ -0,0 +1,4 @@
1
+ module Crt
2
+ VERSION = "0.1.0"
3
+ RAILS_VERSION = "~> 4.2"
4
+ end
data/lib/crt.rb ADDED
@@ -0,0 +1,56 @@
1
+ require "crt/version"
2
+
3
+ require 'rails/generators'
4
+ require 'rails/generators/rails/app/app_generator'
5
+
6
+ module Crt
7
+ class CrtGenerator < Rails::Generators::AppGenerator
8
+
9
+ class_option :database, type: :string, aliases: "-d", default: "mysql",
10
+ desc: "Configure for selected database (options: #{DATABASES.join("/")})"
11
+
12
+ def finish_template
13
+ invoke :import_template
14
+ invoke :setup_database
15
+ super
16
+ end
17
+
18
+ def import_template
19
+ remove_file 'Gemfile'
20
+ template 'Gemfile.erb', 'Gemfile'
21
+ end
22
+
23
+ def customize_gemfile
24
+ build :replace_gemfile
25
+ end
26
+
27
+ def setup_database
28
+
29
+ if 'mysql' == options[:database]
30
+ build :use_mysql2_template
31
+ end
32
+
33
+ end
34
+
35
+ protected
36
+
37
+ def get_builder_class
38
+ Crt::CrtBuilder
39
+ end
40
+
41
+ end
42
+
43
+ class CrtBuilder < Rails::AppBuilder
44
+
45
+ def replace_gemfile
46
+ remove_file 'Gemfile'
47
+ template 'Gemfile.erb', 'Gemfile'
48
+ end
49
+
50
+ def use_mysql2_template
51
+ template 'mysql2_database.yml.erb', 'config/database.yml',
52
+ force: true
53
+ end
54
+
55
+ end
56
+ end
@@ -0,0 +1,96 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'rails', "<%= Crt::RAILS_VERSION %>"
4
+
5
+ # Database
6
+ gem 'mysql2'
7
+
8
+ # Assets
9
+ gem 'sass-rails', '~> 5.0'
10
+ gem 'uglifier', '>= 1.3.0'
11
+ gem 'coffee-rails', '~> 4.1.0'
12
+ gem 'therubyracer', platforms: :ruby
13
+ gem 'oj'
14
+ gem 'jquery-rails'
15
+ gem 'turbolinks'
16
+ gem 'haml-rails'
17
+ gem 'bootstrap-sass'
18
+ gem 'draper'
19
+ gem 'image_optim'
20
+ gem 'image_optim_pack'
21
+
22
+ # File Uploading
23
+ gem 'dragonfly'
24
+ gem 'dragonfly-s3_data_store'
25
+
26
+ # Forms
27
+ gem 'simple_form'
28
+ gem 'kaminari'
29
+ gem 'nested_form'
30
+
31
+ # Static Pages
32
+ gem 'high_voltage'
33
+
34
+ # API
35
+ gem 'jbuilder', '~> 2.0'
36
+ gem 'active_model_serializers'
37
+
38
+ # Documentation
39
+ gem 'sdoc', '~> 0.4.0', group: :doc
40
+ gem 'annotate'
41
+
42
+ # Auditing
43
+ gem 'paper_trail'
44
+
45
+ # Robots.txt
46
+ gem 'roboto'
47
+
48
+ # Server
49
+ gem 'puma'
50
+ gem 'dalli'
51
+ gem 'kgio'
52
+ gem 'rack-cache'
53
+
54
+ # Error Tracking
55
+ gem 'honeybadger'
56
+
57
+ group :development do
58
+ gem 'better_errors'
59
+ gem 'binding_of_caller'
60
+ gem 'meta_request'
61
+ gem 'guard-rspec', require: false
62
+ gem 'guard-cucumber'
63
+ gem 'guard-brakeman'
64
+ gem 'guard-livereload', require: false
65
+ gem 'guard-jasmine'
66
+ gem 'ruby_gntp'
67
+ gem 'rb-fsevent'
68
+ gem 'quiet_assets'
69
+ end
70
+
71
+ group :development, :test do
72
+ gem 'byebug'
73
+ gem 'pry-rails'
74
+ gem 'pry-byebug'
75
+ gem 'web-console', '~> 2.0'
76
+ gem 'spring'
77
+ gem 'spring-commands-rspec'
78
+ gem 'spring-commands-cucumber'
79
+ gem 'rspec-rails'
80
+ gem 'factory_girl_rails'
81
+ gem 'capybara'
82
+ gem 'faker'
83
+ gem 'timecop'
84
+ gem 'jasmine'
85
+ end
86
+
87
+ group :test do
88
+ gem 'cucumber-rails', require: false
89
+ gem 'database_cleaner'
90
+ gem 'vcr'
91
+ gem 'webmock'
92
+ gem 'launchy'
93
+ gem 'poltergeist'
94
+ gem 'shoulda-matchers'
95
+ gem 'email_spec'
96
+ end
@@ -0,0 +1,57 @@
1
+ # MySQL. Versions 5.0+ are recommended.
2
+ #
3
+ # Install the MYSQL driver
4
+ # gem install mysql2
5
+ #
6
+ # Ensure the MySQL gem is defined in your Gemfile
7
+ # gem 'mysql2'
8
+ #
9
+ # And be sure to use new-style password hashing:
10
+ # http://dev.mysql.com/doc/refman/5.0/en/old-client.html
11
+ #
12
+ default: &default
13
+ adapter: mysql2
14
+ encoding: utf8
15
+ pool: 5
16
+ username: root
17
+ password: pw
18
+ socket: /tmp/mysql.sock
19
+
20
+ development:
21
+ <<: *default
22
+ database: <%= app_name %>_development
23
+
24
+ # Warning: The database defined as "test" will be erased and
25
+ # re-generated from your development database when you run "rake".
26
+ # Do not set this db to the same as development or production.
27
+ test: &test
28
+ <<: *default
29
+ database: <%= app_name %>_test
30
+
31
+ # As with config/secrets.yml, you never want to store sensitive information,
32
+ # like your database password, in your source code. If your source code is
33
+ # ever seen by anyone, they now have access to your database.
34
+ #
35
+ # Instead, provide the password as a unix environment variable when you boot
36
+ # the app. Read http://guides.rubyonrails.org/configuring.html#configuring-a-database
37
+ # for a full rundown on how to provide these environment variables in a
38
+ # production deployment.
39
+ #
40
+ # On Heroku and other platform providers, you may have a full connection URL
41
+ # available as an environment variable. For example:
42
+ #
43
+ # DATABASE_URL="mysql2://myuser:mypass@localhost/somedatabase"
44
+ #
45
+ # You can use this database configuration with:
46
+ #
47
+ # production:
48
+ # url: <%= ENV['DATABASE_URL'] %>
49
+ #
50
+ production:
51
+ <<: *default
52
+ database: <%= app_name %>_production
53
+ username: site
54
+ password: <%%= ENV['SITE_DATABASE_PASSWORD'] %>
55
+
56
+ cucumber:
57
+ <<: *test
metadata ADDED
@@ -0,0 +1,116 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: crt
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - monlu
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-08-19 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rails
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '4.2'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '4.2'
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.10'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.10'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '10.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '10.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: pry
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '0.10'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '0.10'
69
+ description: Prototype of Canvas Rails Template
70
+ email:
71
+ - glu@canvas.is
72
+ executables:
73
+ - crt
74
+ extensions: []
75
+ extra_rdoc_files: []
76
+ files:
77
+ - ".gitignore"
78
+ - ".travis.yml"
79
+ - CODE_OF_CONDUCT.md
80
+ - Gemfile
81
+ - LICENSE.txt
82
+ - README.md
83
+ - Rakefile
84
+ - bin/console
85
+ - bin/crt
86
+ - bin/setup
87
+ - crt.gemspec
88
+ - lib/crt.rb
89
+ - lib/crt/version.rb
90
+ - templates/Gemfile.erb
91
+ - templates/mysql2_database.yml.erb
92
+ homepage: https://github.com/monlu/crt
93
+ licenses:
94
+ - MIT
95
+ metadata: {}
96
+ post_install_message:
97
+ rdoc_options: []
98
+ require_paths:
99
+ - lib
100
+ required_ruby_version: !ruby/object:Gem::Requirement
101
+ requirements:
102
+ - - ">="
103
+ - !ruby/object:Gem::Version
104
+ version: '0'
105
+ required_rubygems_version: !ruby/object:Gem::Requirement
106
+ requirements:
107
+ - - ">="
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
110
+ requirements: []
111
+ rubyforge_project:
112
+ rubygems_version: 2.4.8
113
+ signing_key:
114
+ specification_version: 4
115
+ summary: Canvas Rails Template
116
+ test_files: []