straptible 0.1.0 → 0.1.1

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: 3accf78857a747632066bc02d7afff4b2f7dc0a5
4
- data.tar.gz: 1888116854daed1a9a73d68333058491ebfa3d3a
3
+ metadata.gz: 89abf8a2a5ba5c0104455a8c6ace75e2a42482a1
4
+ data.tar.gz: b6b525ca906222cf2ab65ff9374b5fe251f52aa8
5
5
  SHA512:
6
- metadata.gz: 45bc96efb44e90afdf239bc6edfaa0e1e6187e4898f0db1ffc52b9ad3d6e7e19f2f061a058008c89bee76ea24a97237fa316cee2f02c47da269a534f709bfc37
7
- data.tar.gz: 6d2e2cb465444997e631636ebd6c5b7ebb55671c66f0384df36766a127dec6acbe4cf223f0552d8508411aa2f0d0afc116aabac2efa4d0de1286baba172c8086
6
+ metadata.gz: b1e0ad5cdfa8de252d50e0debc905fb71ef3db35365e03febc147a72c333eb4a8755a4dfeef75eda91b4ff14f7ed80b0ba050fd3d49dc607e5c1fd64be37a598
7
+ data.tar.gz: 59a60e7714604f1d48baafc08c51a8a1df8ddc81a747a4a78f3f0ebf0c01e57213d6f04b4dd7dcfee161b1ce76bf94cb1cff8d47128b0439fcd5b4224d491633
data/.travis.yml ADDED
@@ -0,0 +1,5 @@
1
+ before_install:
2
+ - git config --global user.email "travis@aptible.com"
3
+ - git config --global user.name "Travis"
4
+ rvm:
5
+ 2.0.0
data/README.md CHANGED
@@ -1,7 +1,8 @@
1
- # ![](lib/straptible/rails/templates/icon-72.png) Straptible
1
+ # ![](lib/straptible/rails/templates/public.api/icon-72-cropped.png) Straptible
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/straptible.png)](https://rubygems.org/gems/straptible)
4
4
  [![Build Status](https://secure.travis-ci.org/aptible/straptible.png?branch=master)](http://travis-ci.org/aptible/straptible)
5
+ [![Dependency Status](https://gemnasium.com/aptible/straptible.png)](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
- require 'active_support/inflector'
4
-
5
- def require_lib(name)
6
- path = File.join('..', 'lib', *(name.split('::').map(&:underscore)))
7
- require_relative path
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
- require_lib 'Straptible::Rails::Generators::Api'
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
- def remove_error_pages
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 'spec_helper.rb', 'spec/spec_helper.rb'
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
@@ -31,6 +31,12 @@ module Straptible
31
31
  super
32
32
  end
33
33
 
34
+ def git_init
35
+ git init: '.',
36
+ add: '.',
37
+ commit: "-m 'Initial commit (Straptible #{Straptible::VERSION})'"
38
+ end
39
+
34
40
  protected
35
41
 
36
42
  def get_builder_class
@@ -1,10 +1,21 @@
1
- # ![](public/icon-72.png) <%= app_const_base %>
1
+ # ![](public/icon-72-cropped.png) <%= app_const_base %>
2
2
 
3
- [![Build Status](https://secure.travis-ci.org/aptible/<%= app_name %>.png?branch=master)](http://travis-ci.org/aptible/<%= app_name %>)
3
+ TODO: Add description for this API.
4
4
 
5
- A tool for bootstrapping new applications, document repositories, etc. according to Aptible's hyperopinionated best practices.
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) 2013 [Aptible](https://www.aptible.com). All rights reserved.
21
+ Copyright (c) <%= Time.now.strftime("%Y") %> [Aptible](https://www.aptible.com). All rights reserved.
@@ -3,4 +3,5 @@ require File.expand_path('../config/application', __FILE__)
3
3
  <%= app_const %>.load_tasks
4
4
 
5
5
  # Load shared Aptible Rake tasks
6
+ require 'aptible/tasks'
6
7
  Aptible::Tasks.load_tasks
@@ -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:
@@ -0,0 +1,5 @@
1
+ # See http://www.robotstxt.org/wc/norobots.html for documentation on how to use the robots.txt file
2
+ #
3
+ # To ban all spiders from the entire site uncomment the next two lines:
4
+ # User-agent: *
5
+ # Disallow: /
@@ -1,3 +1,3 @@
1
1
  module Straptible
2
- VERSION = '0.1.0'
2
+ VERSION = '0.1.1'
3
3
  end
@@ -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.0
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-25 00:00:00.000000000 Z
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/spec_helper.rb
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