spiker 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
  SHA256:
3
- metadata.gz: 6807d10b0e21344ac48f335257b7a92e41cce9ce140b7f73b3f31545d06d7135
4
- data.tar.gz: cd463be9673e5f188459c1ad61e5460dd5b4e9fb05fe6d61651abfd733de1b2c
3
+ metadata.gz: a83635eae4874bcb567fdcae912b250f3c4096620c5703885d5de9c501527090
4
+ data.tar.gz: f2dc29b6a4dd30cf380c44b68f970f15ac93cea3db71ab86db22c657a4e9ea65
5
5
  SHA512:
6
- metadata.gz: ee478066198cd3b8f3e2bb122d1bd43156dc08a13d2229ad72f1b63f68c67c2ba3d7a6aae8af33d43d319073673228b57dc7ce721b943be61ac8d5c802e2379c
7
- data.tar.gz: e753e0e8618365cd74d7f1ee9a38733a1be9e20102e7ab5c22fdb3693566360ab24d6ea21c5a34e34055b4f60e63de51f76c14804c1ff22e3a3463d2265432ed
6
+ metadata.gz: 63f83edb340f1480c296fbc6eff8e1f943086f0bfecf3146d0f9581d0a674131b66bb196ae65bcf9893e5c3003fa0dda49419b3acdfa06449f27c4118dafc448
7
+ data.tar.gz: '03718cc66377cd005f6a27334da152ab2f331c52e5f58d60a0f24dcc73eda967a30cc94a8479433b59fdc19c577a9bf880ef36e92352bffde3b523069accab0e'
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- spiker (0.1.0)
4
+ spiker (0.1.1)
5
5
  thor (~> 0.19)
6
6
 
7
7
  GEM
@@ -1,6 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "thor/group"
4
+ require_relative "../../spiker"
5
+
4
6
  module Spiker
5
7
  module Generators
6
8
  # Generates a single spike file, with supporting infrastructure.
@@ -19,7 +21,8 @@ module Spiker
19
21
  end
20
22
 
21
23
  def create_spike_file
22
- template("simple_app.rb", "#{name}/app.rb")
24
+ opts = {name_as_class: Spiker.classify(name)}
25
+ template("simple_app.rb", "#{name}/app.rb", opts)
23
26
  end
24
27
 
25
28
  def create_guard_file
@@ -4,13 +4,13 @@ require 'minitest/reporters'
4
4
 
5
5
  Minitest::Reporters.use!
6
6
 
7
- class <%= name.capitalize %>Test < Minitest::Test
7
+ class <%= config[:name_as_class] %>Test < Minitest::Test
8
8
  def test_that_it_works
9
9
  assert true
10
10
  end
11
11
  end
12
12
 
13
- class <%= name.capitalize %>
13
+ class <%= config[:name_as_class] %>
14
14
  attr_accessor :name
15
15
  def initialize(name:)
16
16
  @name = name
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Spiker
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.1"
5
5
  end
data/lib/spiker.rb CHANGED
@@ -4,4 +4,8 @@ require_relative "spiker/version"
4
4
 
5
5
  module Spiker
6
6
  class Error < StandardError; end
7
+
8
+ def self.classify(str)
9
+ str.split(/[^A-Za-z0-0]/).map(&:capitalize).join
10
+ end
7
11
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spiker
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
  - Aaron Norling