straptible 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 89abf8a2a5ba5c0104455a8c6ace75e2a42482a1
4
- data.tar.gz: b6b525ca906222cf2ab65ff9374b5fe251f52aa8
3
+ metadata.gz: e46a7cbb0934f2c311be1bbfbc512daa0d7333ee
4
+ data.tar.gz: acb54cea21f51c3fb34da6df27d426e444c3a2d0
5
5
  SHA512:
6
- metadata.gz: b1e0ad5cdfa8de252d50e0debc905fb71ef3db35365e03febc147a72c333eb4a8755a4dfeef75eda91b4ff14f7ed80b0ba050fd3d49dc607e5c1fd64be37a598
7
- data.tar.gz: 59a60e7714604f1d48baafc08c51a8a1df8ddc81a747a4a78f3f0ebf0c01e57213d6f04b4dd7dcfee161b1ce76bf94cb1cff8d47128b0439fcd5b4224d491633
6
+ metadata.gz: 3853628e60f6c19dccb6ba19a30cd4c2b8d389e9000613036bcf19435bf5f4b795a0155f24cb3c72cd56a5c718078941051cae198e871543989d33e350f96c5f
7
+ data.tar.gz: 9c47b9222ff0d36bc9391c10a6ef29b7d816e68ae44f99a14cd6510d6d8960cca671cb734f6b6dcce3caa76936a5ea969edb9bb8df960e72a94622f19013acd0
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --format=documentation
@@ -3,3 +3,4 @@ before_install:
3
3
  - git config --global user.name "Travis"
4
4
  rvm:
5
5
  2.0.0
6
+ jruby
@@ -21,10 +21,20 @@ module Straptible
21
21
  end
22
22
 
23
23
  def leftovers
24
+ travis_yml
25
+ package_json
24
26
  restructure_app
25
27
  super
26
28
  end
27
29
 
30
+ def travis_yml
31
+ copy_file 'travis.yml.api', '.travis.yml'
32
+ end
33
+
34
+ def package_json
35
+ copy_file 'package.json'
36
+ end
37
+
28
38
  def restructure_app
29
39
  remove_dir 'app/assets'
30
40
  remove_dir 'app/controllers/concerns'
@@ -4,11 +4,12 @@ gem 'rails'
4
4
  gem 'pg'
5
5
  gem 'draper'
6
6
  gem 'rabl'
7
+ gem 'oj'
7
8
 
8
9
  group :development, :test do
9
10
  gem 'annotate'
10
11
  gem 'aptible-tasks'
11
- gem 'rubocop', github: 'bbatsov/rubocop'
12
+ gem 'rabl-generators'
12
13
  gem 'rspec'
13
14
  gem 'rspec-rails'
14
15
  gem 'pry'
@@ -16,6 +16,17 @@ The following command will run Ruby style guide checking, unit tests, and integr
16
16
 
17
17
  bundle exec rake ci
18
18
 
19
+ ## API Blueprint
20
+
21
+ We use [API Blueprint](http://apiblueprint.org/) for API documentation. To compose your blueprint, edit `blueprint.md` according to to the API Blueprint [format](https://github.com/apiaryio/api-blueprint/blob/master/API%20Blueprint%20Specification.md). [This tutorial](http://apiary.io/blueprint) might be a good starting point.
22
+
23
+ To validate the API implementation against its blueprint, first fire up a Rails server, then invoke Dredd:
24
+
25
+ bundle exec rails server -p 3000 -d
26
+ dredd blueprint.md http://localhost:3000
27
+
28
+ To preview the documentation, use Aglio: `aglio -i blueprint.md -p 4000 -s`. Then visit [localhost:4000](http://localhost:4000/).
29
+
19
30
  ## Copyright
20
31
 
21
32
  Copyright (c) <%= Time.now.strftime("%Y") %> [Aptible](https://www.aptible.com). All rights reserved.
@@ -1,7 +1,9 @@
1
1
  require File.expand_path('../config/application', __FILE__)
2
2
 
3
- <%= app_const %>.load_tasks
4
-
5
3
  # Load shared Aptible Rake tasks
6
4
  require 'aptible/tasks'
7
5
  Aptible::Tasks.load_tasks
6
+
7
+ <%= app_const %>.load_tasks
8
+
9
+ task default: :ci
@@ -8,5 +8,20 @@ Bundler.require(:default, Rails.env)
8
8
  module <%= app_const_base %>
9
9
  class Application < Rails::Application
10
10
  config.assets.enabled = false
11
+ config.app_generators.template_engine false
12
+
13
+ config.generators do |g|
14
+ g.stylesheets = false
15
+ g.javascripts = false
16
+ g.helper = false
17
+ g.view_specs = false
18
+
19
+ g.hide_namespace :test_unit
20
+ g.hide_namespace :js
21
+ g.hide_namespace :erb
22
+ g.hide_namespace :mongoid
23
+ end
24
+
25
+ config.filter_parameters += [:password]
11
26
  end
12
27
  end
@@ -1,9 +1,13 @@
1
1
  <%= app_const %>.configure do
2
+ config.secret_key_base =
3
+ '<%= SecureRandom.hex(32) %>' +
4
+ '<%= SecureRandom.hex(32) %>'
5
+
2
6
  config.cache_classes = false
3
7
 
4
8
  config.eager_load = false
5
9
 
6
- config.consider_all_requests_local = true
10
+ config.consider_all_requests_local = false
7
11
  config.action_controller.perform_caching = false
8
12
 
9
13
  config.active_support.deprecation = :log
@@ -1,4 +1,10 @@
1
1
  <%= app_const %>.configure do
2
+ unless config.secret_key_base = ENV['RAILS_SECRET_KEY']
3
+ fail 'RAILS_SECRET_KEY must be set in production mode'
4
+ end
5
+
6
+ config.force_ssl = true
7
+
2
8
  config.cache_classes = true
3
9
 
4
10
  config.eager_load = true
@@ -6,8 +12,6 @@
6
12
  config.consider_all_requests_local = false
7
13
  config.action_controller.perform_caching = true
8
14
 
9
- config.serve_static_assets = false
10
-
11
15
  config.log_level = :info
12
16
 
13
17
  config.i18n.fallbacks = true
@@ -1,15 +1,16 @@
1
1
  <%= app_const %>.configure do
2
+ config.secret_key_base =
3
+ '<%= SecureRandom.hex(32) %>' +
4
+ '<%= SecureRandom.hex(32) %>'
5
+
2
6
  config.cache_classes = true
3
7
 
4
8
  config.eager_load = false
5
9
 
6
- config.serve_static_assets = true
7
- config.static_cache_control = 'public, max-age=3600'
8
-
9
- config.consider_all_requests_local = true
10
+ config.consider_all_requests_local = false
10
11
  config.action_controller.perform_caching = false
11
12
 
12
- config.action_dispatch.show_exceptions = false
13
+ config.action_dispatch.show_exceptions = true
13
14
 
14
15
  config.action_controller.allow_forgery_protection = false
15
16
 
@@ -0,0 +1 @@
1
+ Mime::Type.register 'application/vnd.api+json', :json_api
@@ -1,4 +1,4 @@
1
1
  Rabl.configure do |config|
2
- config.include_json_root = true
2
+ config.include_json_root = false
3
3
  config.include_child_root = false
4
4
  end
@@ -2,3 +2,5 @@
2
2
 
3
3
  /log/*.log
4
4
  /tmp
5
+
6
+ /node_modules
@@ -0,0 +1,13 @@
1
+ {
2
+ "name" : "auth.aptible.com",
3
+ "version" : "0.1.0",
4
+ "repository" : {
5
+ "type" : "git",
6
+ "url" : "https://github.com/aptible/auth.aptible.com.git"
7
+ },
8
+ "dependencies" : {
9
+ "aglio" : "git://github.com/fancyremarker/aglio.git#published",
10
+ "supervisor": "*",
11
+ "dredd" : "*"
12
+ }
13
+ }
@@ -0,0 +1,3 @@
1
+ rvm:
2
+ - 2.0.0
3
+ - jruby
@@ -1,3 +1,3 @@
1
1
  module Straptible
2
- VERSION = '0.1.1'
2
+ VERSION = '0.1.2'
3
3
  end
@@ -67,6 +67,34 @@ describe 'straptible api' do
67
67
  git_log = `cd #{File.join(@tmpdir, 'foobar')} && git log --oneline`
68
68
  git_log.should =~ /Initial commit.*#{Straptible::VERSION}/
69
69
  end
70
+
71
+ it 'has a .travis.yml file which includes JRuby in the build matrix' do
72
+ travis_yml = File.join(@tmpdir, 'foobar', '.travis.yml')
73
+ File.exist?(travis_yml).should be_true
74
+ File.read(travis_yml).should match /jruby/
75
+ end
76
+
77
+ it 'has a package.json for Node dependencies' do
78
+ package_json = File.join(@tmpdir, 'foobar', 'package.json')
79
+ File.exist?(package_json).should be_true
80
+ end
81
+
82
+ it 'has an initializer for the JSON-API MIME type' do
83
+ initializers = File.join(@tmpdir, 'foobar', 'config', 'initializers')
84
+ mime_types = File.join(initializers, 'mime_types.rb')
85
+ File.exist?(mime_types).should be_true
86
+ File.read(mime_types).should match /:json_api/
87
+ end
88
+
89
+ it 'sets config in application.rb instead of config/initializers' do
90
+ initializers = File.join(@tmpdir, 'foobar', 'config', 'initializers')
91
+ filter_parameters = File.join(initializers, 'filter_parameters.rb')
92
+ File.exist?(filter_parameters).should be_false
93
+
94
+ application = File.join(@tmpdir, 'foobar', 'config', 'application.rb')
95
+ File.exist?(application).should be_true
96
+ File.read(application).should match /filter_parameters/
97
+ end
70
98
  end
71
99
 
72
100
  context 'executing bundle install' do
@@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
23
23
  spec.add_dependency 'rails'
24
24
 
25
25
  spec.add_development_dependency 'bundler', '~> 1.3'
26
- spec.add_development_dependency 'aptible-tasks', '~> 0.1.1'
26
+ spec.add_development_dependency 'aptible-tasks', '~> 0.1.2'
27
27
  spec.add_development_dependency 'rake'
28
28
  spec.add_development_dependency 'rspec'
29
29
  spec.add_development_dependency 'pry'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: straptible
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Frank Macreery
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-11-26 00:00:00.000000000 Z
11
+ date: 2013-12-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - ~>
46
46
  - !ruby/object:Gem::Version
47
- version: 0.1.1
47
+ version: 0.1.2
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - ~>
53
53
  - !ruby/object:Gem::Version
54
- version: 0.1.1
54
+ version: 0.1.2
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rake
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -103,6 +103,7 @@ extensions: []
103
103
  extra_rdoc_files: []
104
104
  files:
105
105
  - .gitignore
106
+ - .rspec
106
107
  - .travis.yml
107
108
  - Gemfile
108
109
  - LICENSE.md
@@ -123,19 +124,18 @@ files:
123
124
  - lib/straptible/rails/templates/config.api/environments/development.rb.tt
124
125
  - lib/straptible/rails/templates/config.api/environments/production.rb.tt
125
126
  - lib/straptible/rails/templates/config.api/environments/test.rb.tt
126
- - lib/straptible/rails/templates/config.api/initializers/filter_parameter_logging.rb
127
+ - lib/straptible/rails/templates/config.api/initializers/mime_types.rb
127
128
  - lib/straptible/rails/templates/config.api/initializers/rabl.rb
128
- - lib/straptible/rails/templates/config.api/initializers/secret_token.rb.tt
129
- - lib/straptible/rails/templates/config.api/initializers/session_store.rb.tt
130
129
  - lib/straptible/rails/templates/config.api/initializers/wrap_parameters.rb
131
130
  - lib/straptible/rails/templates/config.api/routes.rb.tt
132
131
  - lib/straptible/rails/templates/gitignore
133
- - lib/straptible/rails/templates/initializers/filter_parameter_logging.rb
132
+ - lib/straptible/rails/templates/package.json
134
133
  - lib/straptible/rails/templates/public.api/favicon.ico
135
134
  - lib/straptible/rails/templates/public.api/icon-72-cropped.png
136
135
  - lib/straptible/rails/templates/public.api/icon-72.png
137
136
  - lib/straptible/rails/templates/public.api/robots.txt
138
137
  - lib/straptible/rails/templates/spec/spec_helper.rb
138
+ - lib/straptible/rails/templates/travis.yml.api
139
139
  - lib/straptible/version.rb
140
140
  - spec/integration/api_spec.rb
141
141
  - spec/spec_helper.rb
@@ -160,7 +160,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
160
160
  version: '0'
161
161
  requirements: []
162
162
  rubyforge_project:
163
- rubygems_version: 2.0.0
163
+ rubygems_version: 2.0.14
164
164
  signing_key:
165
165
  specification_version: 4
166
166
  summary: A tool for bootstrapping new Aptible projects
@@ -1 +0,0 @@
1
- Rails.application.config.filter_parameters += [:password]
@@ -1,3 +0,0 @@
1
- <%= app_const %>.config.secret_key_base =
2
- '<%= SecureRandom.hex(32) %>' +
3
- '<%= SecureRandom.hex(32) %>'
@@ -1 +0,0 @@
1
- <%= app_const %>.config.session_store :cookie_store
@@ -1 +0,0 @@
1
- Rails.application.config.filter_parameters += [:password]