bluebase_api 1.1.1

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.
Files changed (60) hide show
  1. checksums.yaml +7 -0
  2. data/.envrc +1 -0
  3. data/.gitignore +22 -0
  4. data/.hound.yml +6 -0
  5. data/.rubocop.yml +12 -0
  6. data/.ruby-gemset +1 -0
  7. data/.ruby-version +1 -0
  8. data/Gemfile +4 -0
  9. data/LICENSE.txt +22 -0
  10. data/README.md +85 -0
  11. data/Rakefile +8 -0
  12. data/bin/bluebase_api +13 -0
  13. data/bin/build +6 -0
  14. data/bin/bundler +16 -0
  15. data/bin/rake +16 -0
  16. data/bin/rspec +16 -0
  17. data/bluebase_api.gemspec +31 -0
  18. data/lib/bluebase_api.rb +4 -0
  19. data/lib/bluebase_api/actions.rb +25 -0
  20. data/lib/bluebase_api/app_builder.rb +379 -0
  21. data/lib/bluebase_api/generators/app_generator.rb +151 -0
  22. data/lib/bluebase_api/version.rb +5 -0
  23. data/spec/fakes/bin/heroku +5 -0
  24. data/spec/fakes/bin/hub +5 -0
  25. data/spec/features/github_spec.rb +10 -0
  26. data/spec/features/heroku_spec.rb +24 -0
  27. data/spec/features/new_project_spec.rb +68 -0
  28. data/spec/spec_helper.rb +24 -0
  29. data/spec/support/bluebase_api.rb +49 -0
  30. data/spec/support/fake_github.rb +21 -0
  31. data/spec/support/fake_heroku.rb +32 -0
  32. data/templates/.envrc +1 -0
  33. data/templates/.hound.yml +12 -0
  34. data/templates/.rspec +2 -0
  35. data/templates/.rubocop.yml +20 -0
  36. data/templates/Gemfile.erb +65 -0
  37. data/templates/Guardfile +43 -0
  38. data/templates/README.md.erb +30 -0
  39. data/templates/app/controllers/api/base_controller.rb +3 -0
  40. data/templates/app/controllers/bluebase_api_application_controller.rb +5 -0
  41. data/templates/bin/setup +27 -0
  42. data/templates/bluebase_api_gitignore +18 -0
  43. data/templates/config/application.yml.sample.erb +27 -0
  44. data/templates/config/bluebase_api_routes.rb +7 -0
  45. data/templates/config/bluebase_api_secrets.yml +14 -0
  46. data/templates/config/database.yml.sample.erb +15 -0
  47. data/templates/config/database.yml.travis.erb +4 -0
  48. data/templates/config/devise.rb +298 -0
  49. data/templates/config/en.yml.erb +19 -0
  50. data/templates/config/figaro.rb +2 -0
  51. data/templates/config/i18n-tasks.yml +93 -0
  52. data/templates/config/smtp.rb +9 -0
  53. data/templates/config/staging.rb.erb +9 -0
  54. data/templates/spec/action_mailer.rb +5 -0
  55. data/templates/spec/database_cleaner_and_factory_girl_lint.rb +26 -0
  56. data/templates/spec/factory_girl.rb +3 -0
  57. data/templates/spec/i18n.rb +3 -0
  58. data/templates/spec/rails_helper.rb +32 -0
  59. data/templates/spec/spec_helper.rb +17 -0
  60. metadata +194 -0
@@ -0,0 +1,19 @@
1
+ en:
2
+ date:
3
+ formats:
4
+ default:
5
+ "%m/%d/%Y"
6
+ with_weekday:
7
+ "%a %m/%d/%y"
8
+
9
+ time:
10
+ formats:
11
+ default:
12
+ "%a, %b %-d, %Y at %r"
13
+ date:
14
+ "%b %-d, %Y"
15
+ short:
16
+ "%B %d"
17
+
18
+ titles:
19
+ application: <%= app_name.humanize %>
@@ -0,0 +1,2 @@
1
+ # Add keys that figaro requires here.
2
+ Figaro.require_keys "SECRET_KEY_BASE", "DEVISE_SECRET_KEY"
@@ -0,0 +1,93 @@
1
+ # i18n-tasks finds and manages missing and unused translations https://github.com/glebm/i18n-tasks
2
+
3
+ base_locale: en
4
+ ## i18n-tasks detects locales automatically from the existing locale files
5
+ ## uncomment to set locales explicitly
6
+ # locales: [en, es, fr]
7
+
8
+ ## i18n-tasks report locale, default: en, available: en, ru
9
+ # internal_locale: ru
10
+
11
+ # Read and write locale data
12
+ data:
13
+ ## by default, translation data are read from the file system, or you can provide a custom data adapter
14
+ # adapter: I18n::Tasks::Data::FileSystem
15
+
16
+ # Locale files to read from
17
+ read:
18
+ - config/locales/*.%{locale}.yml
19
+ - config/locales/%{locale}.yml
20
+ # - config/locales/*.%{locale}.yml
21
+ # - config/locales/**/*.%{locale}.yml
22
+
23
+ # key => file routes, matched top to bottom
24
+ write:
25
+ ## E.g., write devise and simple form keys to their respective files
26
+ # - ['{devise, simple_form}.*', 'config/locales/\1.%{locale}.yml']
27
+ # Catch-all
28
+ - config/locales/%{locale}.yml
29
+ # `i18n-tasks normalize -p` will force move the keys according to these rules
30
+
31
+ # YAML / JSON serializer options, passed to load / dump / parse / serialize
32
+ yaml:
33
+ write:
34
+ # do not wrap lines at 80 characters
35
+ line_width: -1
36
+ json:
37
+ write:
38
+ # pretty print JSON
39
+ indent: ' '
40
+ space: ' '
41
+ object_nl: "\n"
42
+ array_nl: "\n"
43
+
44
+ # Find translate calls
45
+ search:
46
+ ## Default scanner finds t() and I18n.t() calls
47
+ # scanner: I18n::Tasks::Scanners::PatternWithScopeScanner
48
+
49
+ ## Paths to search in, passed to File.find
50
+ paths:
51
+ - app/
52
+ - spec/
53
+
54
+ ## Root for resolving relative keys (default)
55
+ # relative_roots:
56
+ # - app/views
57
+
58
+ ## File.fnmatch patterns to exclude from search (default)
59
+ # exclude: ["*.jpg", "*.png", "*.gif", "*.svg", "*.ico", "*.eot", "*.ttf", "*.woff", "*.pdf"]
60
+
61
+ ## Or, File.fnmatch patterns to include
62
+ # include: ["*.rb", "*.html.slim"]
63
+
64
+ ## Google Translate
65
+ # translation:
66
+ # # Get an API key and set billing info at https://code.google.com/apis/console to use Google Translate
67
+ # api_key: "AbC-dEf5"
68
+
69
+ ## Consider these keys not missing
70
+ # ignore_missing:
71
+ # - 'errors.messages.{accepted,blank,invalid,too_short,too_long}'
72
+ # - '{devise,simple_form}.*'
73
+
74
+ ## Consider these keys used
75
+ ignore_unused:
76
+ - '{devise,kaminari}.*'
77
+ - 'errors.*'
78
+ - 'titles.*'
79
+ - 'simple_form.{yes,no}'
80
+ - 'simple_form.{placeholders,hints,labels}.*'
81
+ - 'simple_form.{error_notification,required}.:'
82
+ # - 'activerecord.attributes.*'
83
+
84
+ ## Exclude these keys from `i18n-tasks eq-base' report
85
+ # ignore_eq_base:
86
+ # all:
87
+ # - common.ok
88
+ # fr,es:
89
+ # - common.brand
90
+
91
+ ## Exclude these keys from all of the reports
92
+ # ignore:
93
+ # - kaminari.*
@@ -0,0 +1,9 @@
1
+ SMTP_SETTINGS = {
2
+ address: ENV.fetch("SMTP_ADDRESS"), # example: "smtp.sendgrid.net"
3
+ authentication: :plain,
4
+ domain: ENV.fetch("SMTP_DOMAIN"), # example: "this-app.com"
5
+ enable_starttls_auto: true,
6
+ password: ENV.fetch("SMTP_PASSWORD"),
7
+ port: "587",
8
+ user_name: ENV.fetch("SMTP_USERNAME")
9
+ }
@@ -0,0 +1,9 @@
1
+ require_relative "production"
2
+
3
+ Mail.register_interceptor(
4
+ RecipientInterceptor.new(ENV.fetch("EMAIL_RECIPIENTS"), subject_prefix: "[STAGING]")
5
+ )
6
+
7
+ Rails.application.configure do
8
+ config.action_mailer.default_url_options = { host: "staging.<%= app_path %>.com" }
9
+ end
@@ -0,0 +1,5 @@
1
+ RSpec.configure do |config|
2
+ config.before(:each) do
3
+ ActionMailer::Base.deliveries.clear
4
+ end
5
+ end
@@ -0,0 +1,26 @@
1
+ RSpec.configure do |config|
2
+ config.before(:suite) do
3
+ begin
4
+ DatabaseCleaner.clean_with(:truncation)
5
+ FactoryGirl.lint
6
+ ensure
7
+ DatabaseCleaner.clean
8
+ end
9
+ end
10
+
11
+ config.before(:each) do
12
+ DatabaseCleaner.strategy = :transaction
13
+ end
14
+
15
+ config.before(:each, js: true) do
16
+ DatabaseCleaner.strategy = :truncation
17
+ end
18
+
19
+ config.before(:each) do
20
+ DatabaseCleaner.start
21
+ end
22
+
23
+ config.after(:each) do
24
+ DatabaseCleaner.clean
25
+ end
26
+ end
@@ -0,0 +1,3 @@
1
+ RSpec.configure do |config|
2
+ config.include FactoryGirl::Syntax::Methods
3
+ end
@@ -0,0 +1,3 @@
1
+ RSpec.configure do |config|
2
+ config.include AbstractController::Translation
3
+ end
@@ -0,0 +1,32 @@
1
+ # Rspec config for Rails
2
+ ENV["RAILS_ENV"] ||= 'test'
3
+ require 'spec_helper'
4
+ require File.expand_path("../../config/environment", __FILE__)
5
+ require 'rspec/rails'
6
+ require 'shoulda/matchers'
7
+
8
+ # Requires supporting ruby files with custom matchers and macros, etc, in
9
+ # spec/support/ and its subdirectories. Files matching `spec/**/*_spec.rb` are
10
+ # run as spec files by default. This means that files in spec/support that end
11
+ # in _spec.rb will both be required and run as specs, causing the specs to be
12
+ # run twice. It is recommended that you do not name files matching this glob to
13
+ # end with _spec.rb. You can configure this pattern with the --pattern
14
+ # option on the command line or in ~/.rspec, .rspec or `.rspec-local`.
15
+ #
16
+ # The following line is provided for convenience purposes. It has the downside
17
+ # of increasing the boot-up time by auto-requiring all files in the support
18
+ # directory. Alternatively, in the individual `*_spec.rb` files, manually
19
+ # require only the support files necessary.
20
+ #
21
+ Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }
22
+
23
+ # Checks for pending migrations before tests are run.
24
+ ActiveRecord::Migration.maintain_test_schema!
25
+
26
+ RSpec.configure do |config|
27
+ config.use_transactional_fixtures = false
28
+ config.infer_spec_type_from_file_location!
29
+
30
+ # Use t() and l() in tests
31
+ config.include AbstractController::Translation
32
+ end
@@ -0,0 +1,17 @@
1
+ # Start CodeClimate
2
+ require "codeclimate-test-reporter"
3
+ CodeClimate::TestReporter.start
4
+
5
+ # http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
6
+ RSpec.configure do |config|
7
+ config.expect_with :rspec do |expectations|
8
+ expectations.syntax = :expect
9
+ expectations.include_chain_clauses_in_custom_matcher_descriptions = true
10
+ end
11
+
12
+ config.mock_with :rspec do |mocks|
13
+ mocks.syntax = :expect
14
+ end
15
+
16
+ config.order = :random
17
+ end
metadata ADDED
@@ -0,0 +1,194 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: bluebase_api
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.1.1
5
+ platform: ruby
6
+ authors:
7
+ - Sam Lau, Tricia Fu and Quinton Dang
8
+ - Cal Blueprint
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2015-03-21 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rails
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - '='
19
+ - !ruby/object:Gem::Version
20
+ version: 4.2.0
21
+ type: :runtime
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - '='
26
+ - !ruby/object:Gem::Version
27
+ version: 4.2.0
28
+ - !ruby/object:Gem::Dependency
29
+ name: bundler
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - "~>"
33
+ - !ruby/object:Gem::Version
34
+ version: '1.6'
35
+ type: :runtime
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - "~>"
40
+ - !ruby/object:Gem::Version
41
+ version: '1.6'
42
+ - !ruby/object:Gem::Dependency
43
+ name: rspec
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - "~>"
47
+ - !ruby/object:Gem::Version
48
+ version: '3.2'
49
+ - - ">="
50
+ - !ruby/object:Gem::Version
51
+ version: 3.2.0
52
+ type: :development
53
+ prerelease: false
54
+ version_requirements: !ruby/object:Gem::Requirement
55
+ requirements:
56
+ - - "~>"
57
+ - !ruby/object:Gem::Version
58
+ version: '3.2'
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: 3.2.0
62
+ - !ruby/object:Gem::Dependency
63
+ name: pry
64
+ requirement: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '0.10'
69
+ type: :development
70
+ prerelease: false
71
+ version_requirements: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '0.10'
76
+ - !ruby/object:Gem::Dependency
77
+ name: capybara
78
+ requirement: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '2.4'
83
+ type: :development
84
+ prerelease: false
85
+ version_requirements: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '2.4'
90
+ description: |
91
+ Bluebase_api is Blueprint's base Rails API app. We use it internally to get a jump start on our Rails projects.
92
+ email:
93
+ - team@calblueprint.org
94
+ executables:
95
+ - bluebase_api
96
+ - build
97
+ - bundler
98
+ - rake
99
+ - rspec
100
+ extensions: []
101
+ extra_rdoc_files: []
102
+ files:
103
+ - ".envrc"
104
+ - ".gitignore"
105
+ - ".hound.yml"
106
+ - ".rubocop.yml"
107
+ - ".ruby-gemset"
108
+ - ".ruby-version"
109
+ - Gemfile
110
+ - LICENSE.txt
111
+ - README.md
112
+ - Rakefile
113
+ - bin/bluebase_api
114
+ - bin/build
115
+ - bin/bundler
116
+ - bin/rake
117
+ - bin/rspec
118
+ - bluebase_api.gemspec
119
+ - lib/bluebase_api.rb
120
+ - lib/bluebase_api/actions.rb
121
+ - lib/bluebase_api/app_builder.rb
122
+ - lib/bluebase_api/generators/app_generator.rb
123
+ - lib/bluebase_api/version.rb
124
+ - spec/fakes/bin/heroku
125
+ - spec/fakes/bin/hub
126
+ - spec/features/github_spec.rb
127
+ - spec/features/heroku_spec.rb
128
+ - spec/features/new_project_spec.rb
129
+ - spec/spec_helper.rb
130
+ - spec/support/bluebase_api.rb
131
+ - spec/support/fake_github.rb
132
+ - spec/support/fake_heroku.rb
133
+ - templates/.envrc
134
+ - templates/.hound.yml
135
+ - templates/.rspec
136
+ - templates/.rubocop.yml
137
+ - templates/Gemfile.erb
138
+ - templates/Guardfile
139
+ - templates/README.md.erb
140
+ - templates/app/controllers/api/base_controller.rb
141
+ - templates/app/controllers/bluebase_api_application_controller.rb
142
+ - templates/bin/setup
143
+ - templates/bluebase_api_gitignore
144
+ - templates/config/application.yml.sample.erb
145
+ - templates/config/bluebase_api_routes.rb
146
+ - templates/config/bluebase_api_secrets.yml
147
+ - templates/config/database.yml.sample.erb
148
+ - templates/config/database.yml.travis.erb
149
+ - templates/config/devise.rb
150
+ - templates/config/en.yml.erb
151
+ - templates/config/figaro.rb
152
+ - templates/config/i18n-tasks.yml
153
+ - templates/config/smtp.rb
154
+ - templates/config/staging.rb.erb
155
+ - templates/spec/action_mailer.rb
156
+ - templates/spec/database_cleaner_and_factory_girl_lint.rb
157
+ - templates/spec/factory_girl.rb
158
+ - templates/spec/i18n.rb
159
+ - templates/spec/rails_helper.rb
160
+ - templates/spec/spec_helper.rb
161
+ homepage: https://github.com/calblueprint/bluebase_api
162
+ licenses:
163
+ - MIT
164
+ metadata: {}
165
+ post_install_message:
166
+ rdoc_options: []
167
+ require_paths:
168
+ - lib
169
+ required_ruby_version: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - ">="
172
+ - !ruby/object:Gem::Version
173
+ version: 2.2.0
174
+ required_rubygems_version: !ruby/object:Gem::Requirement
175
+ requirements:
176
+ - - ">="
177
+ - !ruby/object:Gem::Version
178
+ version: '0'
179
+ requirements: []
180
+ rubyforge_project:
181
+ rubygems_version: 2.4.6
182
+ signing_key:
183
+ specification_version: 4
184
+ summary: Bluebase_api creates a Rails API app with all of our favorite defaults.
185
+ test_files:
186
+ - spec/fakes/bin/heroku
187
+ - spec/fakes/bin/hub
188
+ - spec/features/github_spec.rb
189
+ - spec/features/heroku_spec.rb
190
+ - spec/features/new_project_spec.rb
191
+ - spec/spec_helper.rb
192
+ - spec/support/bluebase_api.rb
193
+ - spec/support/fake_github.rb
194
+ - spec/support/fake_heroku.rb