straptible 0.1.0 → 0.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.
- checksums.yaml +4 -4
- data/.travis.yml +5 -0
- data/README.md +2 -1
- data/bin/straptible +6 -6
- data/lib/straptible/rails/builders/api.rb +6 -7
- data/lib/straptible/rails/builders/base.rb +1 -8
- data/lib/straptible/rails/generators/base.rb +6 -0
- data/lib/straptible/rails/templates/README.md.tt +15 -4
- data/lib/straptible/rails/templates/Rakefile.tt +1 -0
- data/lib/straptible/rails/templates/config.api/database.yml.tt +2 -2
- data/lib/straptible/rails/templates/{favicon.ico → public.api/favicon.ico} +0 -0
- data/lib/straptible/rails/templates/public.api/icon-72-cropped.png +0 -0
- data/lib/straptible/rails/templates/{icon-72.png → public.api/icon-72.png} +0 -0
- data/lib/straptible/rails/templates/public.api/robots.txt +5 -0
- data/lib/straptible/rails/templates/{spec_helper.rb → spec/spec_helper.rb} +0 -0
- data/lib/straptible/version.rb +1 -1
- data/spec/integration/api_spec.rb +19 -2
- metadata +8 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 89abf8a2a5ba5c0104455a8c6ace75e2a42482a1
|
|
4
|
+
data.tar.gz: b6b525ca906222cf2ab65ff9374b5fe251f52aa8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b1e0ad5cdfa8de252d50e0debc905fb71ef3db35365e03febc147a72c333eb4a8755a4dfeef75eda91b4ff14f7ed80b0ba050fd3d49dc607e5c1fd64be37a598
|
|
7
|
+
data.tar.gz: 59a60e7714604f1d48baafc08c51a8a1df8ddc81a747a4a78f3f0ebf0c01e57213d6f04b4dd7dcfee161b1ce76bf94cb1cff8d47128b0439fcd5b4224d491633
|
data/.travis.yml
ADDED
data/README.md
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
#  Straptible
|
|
1
|
+
#  Straptible
|
|
2
2
|
|
|
3
3
|
[](https://rubygems.org/gems/straptible)
|
|
4
4
|
[](http://travis-ci.org/aptible/straptible)
|
|
5
|
+
[](https://gemnasium.com/aptible/straptible)
|
|
5
6
|
|
|
6
7
|
A tool for bootstrapping new applications, document repositories, etc. according to Aptible's hyperopinionated best practices.
|
|
7
8
|
|
data/bin/straptible
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
begin
|
|
4
|
+
require 'straptible'
|
|
5
|
+
rescue
|
|
6
|
+
require 'rubygems'
|
|
7
|
+
require 'straptible'
|
|
8
8
|
end
|
|
9
9
|
|
|
10
10
|
def usage(dest = $stdout)
|
|
@@ -14,7 +14,7 @@ end
|
|
|
14
14
|
flavor = ARGV.shift
|
|
15
15
|
case flavor
|
|
16
16
|
when 'api'
|
|
17
|
-
|
|
17
|
+
require File.join('straptible', 'rails', 'generators', 'api')
|
|
18
18
|
Straptible::Rails::Generators::Api.start
|
|
19
19
|
when nil
|
|
20
20
|
usage($stderr)
|
|
@@ -16,9 +16,12 @@ module Straptible
|
|
|
16
16
|
directory 'config.api', 'config'
|
|
17
17
|
end
|
|
18
18
|
|
|
19
|
+
def public_directory
|
|
20
|
+
directory 'public.api', 'public'
|
|
21
|
+
end
|
|
22
|
+
|
|
19
23
|
def leftovers
|
|
20
24
|
restructure_app
|
|
21
|
-
remove_error_pages
|
|
22
25
|
super
|
|
23
26
|
end
|
|
24
27
|
|
|
@@ -27,14 +30,10 @@ module Straptible
|
|
|
27
30
|
remove_dir 'app/controllers/concerns'
|
|
28
31
|
remove_dir 'app/helpers'
|
|
29
32
|
remove_dir 'app/mailers'
|
|
33
|
+
remove_dir 'app/models/concerns'
|
|
30
34
|
remove_dir 'app/views/layouts'
|
|
31
|
-
empty_directory 'app/decorators'
|
|
32
|
-
end
|
|
33
35
|
|
|
34
|
-
|
|
35
|
-
remove_file 'public/404.html'
|
|
36
|
-
remove_file 'public/422.html'
|
|
37
|
-
remove_file 'public/500.html'
|
|
36
|
+
empty_directory 'app/decorators'
|
|
38
37
|
end
|
|
39
38
|
end
|
|
40
39
|
end
|
|
@@ -22,18 +22,11 @@ module Straptible
|
|
|
22
22
|
|
|
23
23
|
def leftovers
|
|
24
24
|
rspec
|
|
25
|
-
icons
|
|
26
25
|
end
|
|
27
26
|
|
|
28
27
|
def rspec
|
|
29
28
|
create_file '.rspec', '--color --format documentation'
|
|
30
|
-
copy_file '
|
|
31
|
-
end
|
|
32
|
-
|
|
33
|
-
def icons
|
|
34
|
-
remove_file 'public/favicon.ico'
|
|
35
|
-
copy_file 'favicon.ico', 'public/favicon.ico'
|
|
36
|
-
copy_file 'icon-72.png', 'public/icon-72.png'
|
|
29
|
+
copy_file 'spec/spec_helper.rb'
|
|
37
30
|
end
|
|
38
31
|
end
|
|
39
32
|
end
|
|
@@ -1,10 +1,21 @@
|
|
|
1
|
-
#  <%= app_const_base %>
|
|
1
|
+
#  <%= app_const_base %>
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
TODO: Add description for this API.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## Running Locally
|
|
6
6
|
|
|
7
|
+
git clone git@github.com:aptible/<%= app_name %>.git
|
|
8
|
+
cd <%= app_name %>
|
|
9
|
+
bundle install
|
|
10
|
+
bundle exec rake db:setup
|
|
11
|
+
bundle exec rails s
|
|
12
|
+
|
|
13
|
+
## Continuous Integration
|
|
14
|
+
|
|
15
|
+
The following command will run Ruby style guide checking, unit tests, and integration tests. Make sure it passes before submitting any pull requests!
|
|
16
|
+
|
|
17
|
+
bundle exec rake ci
|
|
7
18
|
|
|
8
19
|
## Copyright
|
|
9
20
|
|
|
10
|
-
Copyright (c)
|
|
21
|
+
Copyright (c) <%= Time.now.strftime("%Y") %> [Aptible](https://www.aptible.com). All rights reserved.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
development:
|
|
2
2
|
adapter: postgresql
|
|
3
3
|
encoding: unicode
|
|
4
|
-
database: <%= app_name %>_development
|
|
4
|
+
database: <%= app_name.gsub('-', '_') %>_development
|
|
5
5
|
pool: 5
|
|
6
6
|
username: aptible
|
|
7
7
|
password:
|
|
@@ -9,7 +9,7 @@ development:
|
|
|
9
9
|
test:
|
|
10
10
|
adapter: postgresql
|
|
11
11
|
encoding: unicode
|
|
12
|
-
database: <%= app_name %>_test
|
|
12
|
+
database: <%= app_name.gsub('-', '_') %>_test
|
|
13
13
|
pool: 5
|
|
14
14
|
username: aptible
|
|
15
15
|
password:
|
|
File without changes
|
|
Binary file
|
|
File without changes
|
|
File without changes
|
data/lib/straptible/version.rb
CHANGED
|
@@ -33,7 +33,7 @@ describe 'straptible api' do
|
|
|
33
33
|
it 'includes an appropriate README.md' do
|
|
34
34
|
readme = File.join(@tmpdir, 'foobar', 'README.md')
|
|
35
35
|
File.exist?(readme).should be_true
|
|
36
|
-
File.read(readme).should match /\#.*public\/icon-72.png.*Foobar/
|
|
36
|
+
File.read(readme).should match /\#.*public\/icon-72-cropped.png.*Foobar/
|
|
37
37
|
end
|
|
38
38
|
|
|
39
39
|
it 'does not include HTML error pages' do
|
|
@@ -50,6 +50,23 @@ describe 'straptible api' do
|
|
|
50
50
|
app = File.join(@tmpdir, 'foobar', 'app')
|
|
51
51
|
File.exist?(File.join(app, 'decorators')).should be_true
|
|
52
52
|
end
|
|
53
|
+
|
|
54
|
+
it 'has a spec/spec_helper.rb' do
|
|
55
|
+
spec = File.join(@tmpdir, 'foobar', 'spec')
|
|
56
|
+
File.exist?(File.join(spec, 'spec_helper.rb')).should be_true
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
it 'has a valid database.yml' do
|
|
60
|
+
database_yml = File.join(@tmpdir, 'foobar', 'config', 'database.yml')
|
|
61
|
+
File.exist?(database_yml).should be_true
|
|
62
|
+
File.read(database_yml).should match /foobar_development/
|
|
63
|
+
File.read(database_yml).should match /foobar_test/
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
it 'is initialized as a Git repository' do
|
|
67
|
+
git_log = `cd #{File.join(@tmpdir, 'foobar')} && git log --oneline`
|
|
68
|
+
git_log.should =~ /Initial commit.*#{Straptible::VERSION}/
|
|
69
|
+
end
|
|
53
70
|
end
|
|
54
71
|
|
|
55
72
|
context 'executing bundle install' do
|
|
@@ -63,7 +80,7 @@ describe 'straptible api' do
|
|
|
63
80
|
end
|
|
64
81
|
|
|
65
82
|
it 'passes Rubocop muster' do
|
|
66
|
-
`cd #{File.join(@tmpdir, 'foobar')} && rake rubocop`
|
|
83
|
+
`cd #{File.join(@tmpdir, 'foobar')} && bundle exec rake rubocop`
|
|
67
84
|
$CHILD_STATUS.exitstatus.should == 0
|
|
68
85
|
end
|
|
69
86
|
|
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.
|
|
4
|
+
version: 0.1.1
|
|
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-
|
|
11
|
+
date: 2013-11-26 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|
|
@@ -103,6 +103,7 @@ extensions: []
|
|
|
103
103
|
extra_rdoc_files: []
|
|
104
104
|
files:
|
|
105
105
|
- .gitignore
|
|
106
|
+
- .travis.yml
|
|
106
107
|
- Gemfile
|
|
107
108
|
- LICENSE.md
|
|
108
109
|
- README.md
|
|
@@ -128,11 +129,13 @@ files:
|
|
|
128
129
|
- lib/straptible/rails/templates/config.api/initializers/session_store.rb.tt
|
|
129
130
|
- lib/straptible/rails/templates/config.api/initializers/wrap_parameters.rb
|
|
130
131
|
- lib/straptible/rails/templates/config.api/routes.rb.tt
|
|
131
|
-
- lib/straptible/rails/templates/favicon.ico
|
|
132
132
|
- lib/straptible/rails/templates/gitignore
|
|
133
|
-
- lib/straptible/rails/templates/icon-72.png
|
|
134
133
|
- lib/straptible/rails/templates/initializers/filter_parameter_logging.rb
|
|
135
|
-
- lib/straptible/rails/templates/
|
|
134
|
+
- lib/straptible/rails/templates/public.api/favicon.ico
|
|
135
|
+
- lib/straptible/rails/templates/public.api/icon-72-cropped.png
|
|
136
|
+
- lib/straptible/rails/templates/public.api/icon-72.png
|
|
137
|
+
- lib/straptible/rails/templates/public.api/robots.txt
|
|
138
|
+
- lib/straptible/rails/templates/spec/spec_helper.rb
|
|
136
139
|
- lib/straptible/version.rb
|
|
137
140
|
- spec/integration/api_spec.rb
|
|
138
141
|
- spec/spec_helper.rb
|