skellington 0.2.2 → 0.3.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e73a864def7705c0498bfa5132a9040690b494a2
4
- data.tar.gz: 791371bf276721499f87a9914e292cf930f8eb95
3
+ metadata.gz: e3539e4dd5332068e47445bf3132f8f3a4274b5e
4
+ data.tar.gz: 2de4b79f72099f5cea933724adfa2af9faa90826
5
5
  SHA512:
6
- metadata.gz: 200c6b249468816d5550d7ea3bab8820c9b64c6739a4e4be061eb25674de588ca8b79245ab714b85ef7d52484deb662e76c6eab12eb5e1e37423efb7f5b77e37
7
- data.tar.gz: df949ef150a09b672830fee0956cbd77ddf641a64fb14457de8821feff673a9b265073ded3d7cd5e8db2f71164e0adc1fb64e7c9277d2bab409c2faeeb4fcda1
6
+ metadata.gz: 15c94756c1749f87ace4e5eef0dd356ffbe356f3ed447dd2f6aebabe2e315ea0ee50e137a67330c05ac114a439cda9211a6f963c429faf9225e519569a7b8309
7
+ data.tar.gz: 20f36a612598de984bad7a6daccff515631a705c66d42ddcd45f96bed9129735892bfc99abacfee19ce83c8b5de9b73da7e79abe960e7b82499347bb05edf180
data/README.md CHANGED
@@ -11,33 +11,34 @@
11
11
  Generate tedious [Cucumber](http://cukes.info/) and [Sinatra](http://www.sinatrarb.com/) boilerplate like a boss. Should work fine for both RVM- and rbenv-based setups
12
12
 
13
13
  $ gem install skellington
14
- $ skellington generate naming_things_is_hard
14
+ $ skellington generate naming-things-is-hard
15
+ Generating naming_things_is_hard/Gemfile...done
16
+ Generating naming_things_is_hard/Rakefile...done
17
+ Generating naming_things_is_hard/Procfile...done
18
+ Generating naming_things_is_hard/.ruby-version...done
19
+ Generating naming_things_is_hard/config.ru...done
20
+ Generating naming_things_is_hard/features/naming_things_is_hard.feature...done
21
+ Generating naming_things_is_hard/features/support/env.rb...done
22
+ Generating naming_things_is_hard/lib/naming_things_is_hard.rb...done
15
23
 
16
- Generating naming_things_is_hard/Gemfile...done
17
- Generating naming_things_is_hard/Rakefile...done
18
- Generating naming_things_is_hard/Procfile...done
19
- Generating naming_things_is_hard/config.ru...done
20
- Generating naming_things_is_hard/features/naming_things_is_hard.feature...done
21
- Generating naming_things_is_hard/features/support/env.rb...done
22
- Generating naming_things_is_hard/lib/naming_things_is_hard.rb...done
23
- Generating naming_things_is_hard/.ruby-version...done
24
+ Your new Sinatra app NamingThingsIsHard has been created
24
25
 
25
- Your new Sinatra app 'NamingThingsIsHard' has been created
26
+ (Note that 'naming-things-is-hard' has been changed to 'naming_things_is_hard' because Ruby finds '-'s troubling)
26
27
 
27
- Now do
28
+ Now do
28
29
 
29
- cd naming_things_is_hard
30
- bundle
31
- rake
30
+ cd naming_things_is_hard
31
+ bundle
32
+ rake
32
33
 
33
- And presuming that passes OK
34
+ And presuming that passes OK
34
35
 
35
- git add .
36
- git commit -m 'First commit'
36
+ git add .
37
+ git commit -m 'First commit'
37
38
 
38
- You can run the app with
39
+ You can run the app with
39
40
 
40
- rackup
41
+ rackup
41
42
 
42
43
  This assumes a bunch of things, at least:
43
44
 
@@ -0,0 +1,27 @@
1
+ Feature: Generate skellington
2
+
3
+ Scenario: change the names if there are hyphens
4
+ When I successfully run `skellington generate hyphenated-name`
5
+ Then the output should contain "Generating hyphenated_name/Gemfile"
6
+ And the output should contain "bundle"
7
+ And the output should contain:
8
+ """
9
+ Your new Sinatra app HyphenatedName has been created
10
+
11
+ (Note that 'hyphenated-name' has been changed to 'hyphenated_name' because Ruby finds '-'s troubling)
12
+
13
+ Now do
14
+
15
+ cd hyphenated_name
16
+ bundle
17
+ rake
18
+
19
+ And presuming that passes OK
20
+
21
+ git add .
22
+ git commit -m 'First commit'
23
+
24
+ You can run the app with
25
+
26
+ rackup
27
+ """
@@ -1,11 +1,12 @@
1
1
  module Skellington
2
2
  class Generator
3
- attr_reader :path, :wormname, :camelname, :files, :gems
3
+ attr_reader :path, :filename, :camelname, :files, :gems
4
4
 
5
5
  def initialize path
6
- @path = File.dirname path
7
- @wormname = File.basename(path).gsub('-', '_')
8
- @camelname = Skellington.camelise(@wormname)
6
+ @full_path = path
7
+ @path = File.dirname @full_path
8
+ @filename = File.basename(@full_path)
9
+ @camelname = Skellington.camelise(wormname)
9
10
  @gems = config['gems']
10
11
  @files = config['files']
11
12
  end
@@ -27,8 +28,16 @@ module Skellington
27
28
  end
28
29
  end
29
30
 
31
+ def wormname
32
+ @filename.gsub('-', '_')
33
+ end
34
+
35
+ def renamed
36
+ @filename != wormname
37
+ end
38
+
30
39
  def git_init
31
- Git.init @wormname
40
+ Git.init wormname
32
41
  end
33
42
 
34
43
  def post_run
@@ -1,3 +1,3 @@
1
1
  module Skellington
2
- VERSION = "0.2.2"
2
+ VERSION = "0.3.0"
3
3
  end
@@ -1,6 +1,10 @@
1
1
 
2
2
  Your new Sinatra app <%= @gen.camelname %> has been created
3
3
 
4
+ <% if @gen.renamed %>
5
+ (Note that '<%= @gen.filename %>' has been changed to '<%= @gen.wormname %>' because Ruby finds '-'s troubling)
6
+
7
+ <% end %>
4
8
  Now do
5
9
 
6
10
  cd <%= @gen.wormname %>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: skellington
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - pikesley
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-06 00:00:00.000000000 Z
11
+ date: 2015-02-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -188,6 +188,7 @@ files:
188
188
  - features/cukes.feature
189
189
  - features/gemfile.feature
190
190
  - features/git.feature
191
+ - features/hyphens.feature
191
192
  - features/naming.feature
192
193
  - features/non-local-path.feature
193
194
  - features/procfile.feature
@@ -243,6 +244,7 @@ test_files:
243
244
  - features/cukes.feature
244
245
  - features/gemfile.feature
245
246
  - features/git.feature
247
+ - features/hyphens.feature
246
248
  - features/naming.feature
247
249
  - features/non-local-path.feature
248
250
  - features/procfile.feature