simplate 0.0.9 → 0.0.10
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/bin/simplate +9 -0
- data/lib/simplate/copies/Gemfile +1 -0
- data/lib/simplate/copies/spec_helper.rb +10 -0
- data/lib/simplate/modules/command.rb +57 -0
- data/lib/simplate/version.rb +1 -1
- data/simplate/Gemfile +1 -0
- data/simplate/spec/spec_helper.rb +10 -0
- data/spec/modules/command_spec.rb +17 -0
- data/spec/modules/simplate_spec.rb +9 -0
- data/spec/spec_helper.rb +10 -0
- metadata +16 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bd1d845e0ce6e34df5f0f736027e7b8bf90cd784
|
4
|
+
data.tar.gz: 6b8c852a0bbf07ccd6b654d7ef30865f95706696
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 949ab6c3ef89ce6bf2a800630a168dd195c980e25c983c17226a1e3cefa78f85c48bd9d0e76575ece37f80f250a0bcf4908ea361d337f5f0e67e599771884bb9
|
7
|
+
data.tar.gz: 5f51b882b885197fc52abf41b8bd4c0ab1749b6e429503302317e918a3882dd9aaf1577f81c9d9a3dbb95510bafc6b3adea2abe383e792a5478c2fe8a8412245
|
data/bin/simplate
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
source 'https://rubygems.org'
|
@@ -0,0 +1,10 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
|
3
|
+
pathname_modules = Pathname.new(Dir.pwd).parent.join("lib/modules")
|
4
|
+
pathname_models = Pathname.new(Dir.pwd).parent.join("lib/models")
|
5
|
+
|
6
|
+
Dir["#{pathname_modules}/*.rb"].each {|file| require file}
|
7
|
+
Dir["#{pathname_models}/*.rb"].each {|file| require file}
|
8
|
+
|
9
|
+
RSpec.configure do |config|
|
10
|
+
end
|
@@ -0,0 +1,57 @@
|
|
1
|
+
module Simplate
|
2
|
+
module Command
|
3
|
+
@@app_name = ''
|
4
|
+
@@root_path = ''
|
5
|
+
|
6
|
+
def Command.root_path
|
7
|
+
Pathname.new(File.dirname(__FILE__)).parent.parent.parent
|
8
|
+
end
|
9
|
+
|
10
|
+
def Command.app_name
|
11
|
+
@@app_name
|
12
|
+
end
|
13
|
+
|
14
|
+
def Command.app_name=(value)
|
15
|
+
@@app_name = value
|
16
|
+
end
|
17
|
+
|
18
|
+
def Command.prepare(app_name)
|
19
|
+
@@app_name = app_name
|
20
|
+
|
21
|
+
Command.executables(app_name).each do |c|
|
22
|
+
`#{c}`
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
def Command.executables(app_name)
|
27
|
+
Command.app_name = app_name
|
28
|
+
|
29
|
+
executables = []
|
30
|
+
|
31
|
+
executables << "mkdir #{app_name}"
|
32
|
+
executables << "mkdir #{app_name}/lib"
|
33
|
+
executables << "mkdir #{app_name}/lib/models"
|
34
|
+
executables << "mkdir #{app_name}/lib/modules"
|
35
|
+
executables << "mkdir #{app_name}/spec"
|
36
|
+
executables << "mkdir #{app_name}/spec/models"
|
37
|
+
executables << "mkdir #{app_name}/spec/modules"
|
38
|
+
executables << Command.copy_file('Gemfile')
|
39
|
+
executables << Command.copy_file('spec_helper.rb')
|
40
|
+
|
41
|
+
executables
|
42
|
+
end
|
43
|
+
|
44
|
+
def Command.copy_file(filename)
|
45
|
+
case filename
|
46
|
+
when "Gemfile"
|
47
|
+
from = Command.root_path.join('lib/simplate/copies/Gemfile')
|
48
|
+
to = Command.app_name + '/Gemfile'
|
49
|
+
"cp #{from} #{to}"
|
50
|
+
when "spec_helper.rb"
|
51
|
+
from = Command.root_path.join('lib/simplate/copies/spec_helper.rb')
|
52
|
+
to = Command.app_name + '/spec/spec_helper.rb'
|
53
|
+
"cp #{from} #{to}"
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
data/lib/simplate/version.rb
CHANGED
data/simplate/Gemfile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
source 'https://rubygems.org'
|
@@ -0,0 +1,10 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
|
3
|
+
pathname_modules = Pathname.new(Dir.pwd).parent.join("lib/modules")
|
4
|
+
pathname_models = Pathname.new(Dir.pwd).parent.join("lib/models")
|
5
|
+
|
6
|
+
Dir["#{pathname_modules}/*.rb"].each {|file| require file}
|
7
|
+
Dir["#{pathname_models}/*.rb"].each {|file| require file}
|
8
|
+
|
9
|
+
RSpec.configure do |config|
|
10
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Simplate::Command do
|
4
|
+
|
5
|
+
it '.prepare' do
|
6
|
+
Simplate::Command.app_name = 'simplate'
|
7
|
+
Simplate::Command.app_name.should eql('simplate')
|
8
|
+
end
|
9
|
+
|
10
|
+
it '.executables' do
|
11
|
+
executables = Simplate::Command.executables('simplate2')
|
12
|
+
|
13
|
+
Simplate::Command.app_name.should eql('simplate2')
|
14
|
+
executables.class.should eql(Array)
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
|
3
|
+
pathname_modules = Pathname.new(File.dirname(__FILE__)).parent.join("lib/simplate/modules")
|
4
|
+
Dir["#{pathname_modules}/*.rb"].each {|file| require file}
|
5
|
+
|
6
|
+
pathname_root_module = Pathname.new(File.dirname(__FILE__)).parent.join('lib')
|
7
|
+
Dir["#{pathname_root_module}/*.rb"].each {|file| require file}
|
8
|
+
|
9
|
+
RSpec.configure do |config|
|
10
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simplate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jason Kim
|
@@ -42,7 +42,8 @@ description: Simplate generates a perfect directory structure for a well organiz
|
|
42
42
|
Ruby app
|
43
43
|
email:
|
44
44
|
- iamjsonkim@gmail.com
|
45
|
-
executables:
|
45
|
+
executables:
|
46
|
+
- simplate
|
46
47
|
extensions: []
|
47
48
|
extra_rdoc_files: []
|
48
49
|
files:
|
@@ -51,9 +52,18 @@ files:
|
|
51
52
|
- LICENSE.txt
|
52
53
|
- README.md
|
53
54
|
- Rakefile
|
55
|
+
- bin/simplate
|
54
56
|
- lib/simplate.rb
|
57
|
+
- lib/simplate/copies/Gemfile
|
58
|
+
- lib/simplate/copies/spec_helper.rb
|
59
|
+
- lib/simplate/modules/command.rb
|
55
60
|
- lib/simplate/version.rb
|
56
61
|
- simplate.gemspec
|
62
|
+
- simplate/Gemfile
|
63
|
+
- simplate/spec/spec_helper.rb
|
64
|
+
- spec/modules/command_spec.rb
|
65
|
+
- spec/modules/simplate_spec.rb
|
66
|
+
- spec/spec_helper.rb
|
57
67
|
homepage: ''
|
58
68
|
licenses:
|
59
69
|
- MIT
|
@@ -78,4 +88,7 @@ rubygems_version: 2.2.0
|
|
78
88
|
signing_key:
|
79
89
|
specification_version: 4
|
80
90
|
summary: Boilerplate for creating an opinionated Ruby app
|
81
|
-
test_files:
|
91
|
+
test_files:
|
92
|
+
- spec/modules/command_spec.rb
|
93
|
+
- spec/modules/simplate_spec.rb
|
94
|
+
- spec/spec_helper.rb
|