skellington 0.1.3 → 0.1.4

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: 22c2fe6f47f008f1236144f8530f04bd5d688a34
4
- data.tar.gz: e9879bb33aca212bd00c3165f697ea646b814f10
3
+ metadata.gz: 2739b831dcd3dd63fc0240d7f689b06ddc101fca
4
+ data.tar.gz: ea34582333e0d1b0d6b28f006ef2ad77542566f7
5
5
  SHA512:
6
- metadata.gz: 93c97bb9de3f67378aa600423da51d8e0bf194b94c7a5ce3dbd9e8807dafbcf9878e3f3ac6ee60efd3c5aea2e330483b17270106f08845410dfc7c929c9e3106
7
- data.tar.gz: 399ae0d91028c49bb31fea5635893e4cff9fab1fe87531bf23c5a82cd02dd9cf5c3844036bc8063c196064f9d4aaf54ea4d4dea55f3debf67767f77162a04cbb
6
+ metadata.gz: 30bff07c1969faa28dd6e1f8fec11b17e5664b6625fc4eadd31cb4097643b73e4d09121257daa17e2d604c3008521e255fd6ef90c0202fa15d4a08b347e2a247
7
+ data.tar.gz: 26e428f717b10cf08da1516ca778d858ba9b190946c272aa9d1d7d7c4cbbedd09d8dc096029e4b5a81118dfe3a0cfee4b37fb500ee93d224d2c64a76b5b32d15
data/config/config.yaml CHANGED
@@ -20,9 +20,9 @@ files:
20
20
  config.ru:
21
21
  # the template has this name
22
22
  features/first.feature:
23
- # but the output file substitutes it like this, where path is an attribute
23
+ # but the output file substitutes it like this, where wormname is an attribute
24
24
  # on the Generator object
25
- outpath: first/path
25
+ outpath: first/wormname
26
26
  features/support/env.rb:
27
27
  lib/app.rb:
28
- outpath: app/path
28
+ outpath: app/wormname
data/features/cli.feature CHANGED
@@ -4,8 +4,26 @@ Feature: Generate skellington
4
4
  When I successfully run `skellington generate dummy_app`
5
5
  Then the output should contain "Generating dummy_app/Gemfile"
6
6
  And the output should contain "bundle"
7
- And the output should contain "rake"
7
+ And the output should contain:
8
+ """
9
+ Your new Sinatra app DummyApp has been created
10
+
11
+ Now do
12
+
13
+ cd dummy_app
14
+ bundle
15
+ rake
16
+
17
+ And presuming that passes OK
18
+
19
+ git add .
20
+ git commit -m 'First commit'
21
+
22
+ You can run the app with
23
+
24
+ rackup
25
+ """
8
26
 
9
27
  Scenario: get the version
10
28
  When I successfully run `skellington -v`
11
- Then the output should contain "skellington version"
29
+ Then the output should contain "skellington version"
@@ -6,9 +6,9 @@ module Skellington
6
6
  end
7
7
  map %w(-v --version) => :version
8
8
 
9
- desc 'generate PATH', 'Generate a skeleton Sinatra app at PATH'
10
- def generate path
11
- @g = Generator.new path
9
+ desc 'generate some_path', 'Generate a skeleton Sinatra app named SomePath at some_path'
10
+ def generate wormname
11
+ @g = Generator.new wormname
12
12
  @g.run
13
13
  end
14
14
  end
@@ -1,12 +1,16 @@
1
1
  module Skellington
2
2
  class Generator
3
- attr_accessor :config, :path, :camelname, :files
3
+ attr_reader :wormname, :camelname, :files, :gems
4
4
 
5
- def initialize path
6
- @path = path
7
- @camelname = Skellington.camelise(@path)
8
- @config = YAML.load File.read File.join File.dirname(__FILE__), '..', '..', 'config/config.yaml'
9
- @files = @config['files']
5
+ def initialize wormname
6
+ @wormname = wormname
7
+ @camelname = Skellington.camelise(@wormname)
8
+ @gems = config['gems']
9
+ @files = config['files']
10
+ end
11
+
12
+ def config
13
+ @config ||= YAML.load File.read File.join File.dirname(__FILE__), '..', '..', 'config/config.yaml'
10
14
  end
11
15
 
12
16
  def run
@@ -16,7 +20,6 @@ module Skellington
16
20
  end
17
21
 
18
22
  def generate
19
- puts ''
20
23
  @files.each do |k, v|
21
24
  t = Template.new k, self
22
25
  t.write
@@ -24,15 +27,12 @@ module Skellington
24
27
  end
25
28
 
26
29
  def git_init
27
- Git.init @path
30
+ Git.init @wormname
28
31
  end
29
32
 
30
33
  def post_run
31
- puts ''
32
- puts "Your new Sinatra app '#{Skellington.camelise(@path)}' has been created"
33
34
  t = Template.new 'post-run', self
34
35
  puts t.to_s
35
- puts ''
36
36
  end
37
37
  end
38
38
  end
@@ -1,7 +1,5 @@
1
1
  module Skellington
2
2
  def self.camelise worm_case
3
- parts = worm_case.split '_'
4
- parts.map! { |word| "#{word[0].upcase}#{word[1..-1]}" }
5
- parts.join ''
3
+ worm_case.split('_').map! { |word| "#{word[0].upcase}#{word[1..-1]}" }.join ''
6
4
  end
7
5
  end
@@ -10,7 +10,7 @@ module Skellington
10
10
  subs = @generator.files[@name]['outpath'].split '/'
11
11
  @outpath = "#{@generator.send(subs[1].to_sym)}/#{@name.sub(subs[0], @generator.send(subs[1].to_sym))}"
12
12
  rescue NoMethodError
13
- @outpath = "#{@generator.path}/#{@name}"
13
+ @outpath = "#{@generator.wormname}/#{@name}"
14
14
  end
15
15
  end
16
16
 
@@ -1,3 +1,3 @@
1
1
  module Skellington
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
@@ -2,15 +2,15 @@ source 'https://rubygems.org'
2
2
 
3
3
  ruby '<%= RUBY_VERSION %>'
4
4
 
5
- <% for gem in @gen.config['gems']['production'] %>
5
+ <% for gem in @gen.gems['production'] %>
6
6
  gem '<%= gem %>'
7
7
  <% end %>
8
8
 
9
9
  group :test do
10
- <% for gem in @gen.config['gems']['test'] %>
10
+ <% for gem in @gen.gems['test'] %>
11
11
  gem '<%= gem %>'
12
12
  <% end %>
13
- <% for gem in @gen.config['gems']['test_require_false'] %>
13
+ <% for gem in @gen.gems['test_require_false'] %>
14
14
  gem '<%= gem %>', require: false
15
15
  <% end %>
16
16
  end
@@ -1 +1 @@
1
- web: bundle exec ruby lib/<%= @gen.path %>.rb
1
+ web: bundle exec ruby lib/<%= @gen.wormname %>.rb
@@ -1,4 +1,4 @@
1
- require File.join(File.dirname(__FILE__), 'lib/<%= @gen.path %>.rb')
1
+ require File.join(File.dirname(__FILE__), 'lib/<%= @gen.wormname %>.rb')
2
2
 
3
3
  unless ENV['RACK_ENV'] == 'production'
4
4
  require 'rspec/core/rake_task'
@@ -1,4 +1,4 @@
1
1
  require 'rubygems'
2
- require File.join(File.dirname(__FILE__), 'lib/<%= @gen.path %>.rb')
2
+ require File.join(File.dirname(__FILE__), 'lib/<%= @gen.wormname %>.rb')
3
3
 
4
4
  run <%= @gen.camelname %>
@@ -1,6 +1,6 @@
1
1
  ENV['RACK_ENV'] = 'test'
2
2
 
3
- require File.join(File.dirname(__FILE__), '..', '..', 'lib/<%= @gen.path %>.rb')
3
+ require File.join(File.dirname(__FILE__), '..', '..', 'lib/<%= @gen.wormname %>.rb')
4
4
 
5
5
  require 'capybara'
6
6
  require 'capybara/cucumber'
@@ -1,7 +1,9 @@
1
1
 
2
+ Your new Sinatra app <%= @gen.camelname %> has been created
3
+
2
4
  Now do
3
5
 
4
- cd <%= @gen.path %>
6
+ cd <%= @gen.wormname %>
5
7
  bundle
6
8
  rake
7
9
 
data/spec/spec_helper.rb CHANGED
@@ -1,4 +1,7 @@
1
1
  require 'skellington'
2
+ require 'coveralls'
3
+
4
+ Coveralls.wear_merged!
2
5
 
3
6
  RSpec.configure do |config|
4
7
  config.expect_with :rspec do |expectations|
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.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - pikesley
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-19 00:00:00.000000000 Z
11
+ date: 2015-01-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -181,7 +181,6 @@ files:
181
181
  - LICENSE.txt
182
182
  - README.md
183
183
  - Rakefile
184
- - Rakefile.ffs
185
184
  - bin/skellington
186
185
  - config/config.yaml
187
186
  - features/app.feature
data/Rakefile.ffs DELETED
@@ -1,10 +0,0 @@
1
- require 'bundler/gem_tasks'
2
- require 'rspec/core/rake_task'
3
- require 'cucumber/rake/task'
4
- require 'coveralls/rake/task'
5
-
6
- Coveralls::RakeTask.new
7
- RSpec::Core::RakeTask.new
8
- Cucumber::Rake::Task.new
9
-
10
- task :default => [:spec, :cucumber, 'coveralls:push']