my-simon 0.1.5 → 0.1.6
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.
- data/VERSION +1 -1
- data/bin/simon +7 -5
- data/lib/simon.rb +40 -0
- data/my-simon.gemspec +1 -1
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.6
|
data/bin/simon
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
# encoding: utf-8
|
2
3
|
|
3
4
|
# resolve bin path, ignoring symlinks
|
4
5
|
require "pathname"
|
@@ -28,8 +29,9 @@ command :create do |c|
|
|
28
29
|
Kernel::system(cmd)
|
29
30
|
cmd = "cd ./app/"
|
30
31
|
Kernel::system(cmd)
|
31
|
-
|
32
|
-
|
32
|
+
simon_controller.msg "Boilerplate added"
|
33
|
+
|
34
|
+
simon_controller.setup
|
33
35
|
|
34
36
|
end
|
35
37
|
end
|
@@ -44,9 +46,9 @@ command :add do |c|
|
|
44
46
|
# Do something or c.when_called My-simon::Commands::Add,
|
45
47
|
case args[0]
|
46
48
|
when 'heroku'
|
47
|
-
cmd = "svn export #{svn_path_heroku}
|
49
|
+
cmd = "svn export #{svn_path_heroku} app --quiet --force"
|
48
50
|
Kernel::system(cmd)
|
49
|
-
|
51
|
+
simon_controller.msg "installing heroku files"
|
50
52
|
end
|
51
53
|
end
|
52
54
|
end
|
@@ -58,7 +60,7 @@ command :setup do |c|
|
|
58
60
|
c.example 'description', 'command example'
|
59
61
|
c.option '--some-switch', 'Some switch that does something'
|
60
62
|
c.action do |args, options|
|
61
|
-
|
63
|
+
simon_controller.setup
|
62
64
|
end
|
63
65
|
end
|
64
66
|
|
data/lib/simon.rb
CHANGED
@@ -1,7 +1,47 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
require 'commander/import'
|
1
3
|
class Simon
|
2
4
|
|
3
5
|
def rename
|
4
6
|
puts "rename called"
|
5
7
|
end
|
6
8
|
|
9
|
+
def msg(msg)
|
10
|
+
puts "---> #{msg}"
|
11
|
+
end
|
12
|
+
|
13
|
+
def complete()
|
14
|
+
puts "\n( ͡° ͜ʖ ͡°) --thank you"
|
15
|
+
end
|
16
|
+
|
17
|
+
def setup
|
18
|
+
name_space = ask("Namespace [a-zA-Z0-9_] : ") { |q| q.echo = true }
|
19
|
+
|
20
|
+
@nms = Regexp.escape(name_space) # escape any special characters
|
21
|
+
# javascript
|
22
|
+
cmd = "find . -type f -name '*.js' -exec sed -i '' s/CHANGE_ME/#{@nms}/ {} +"
|
23
|
+
Kernel::system(cmd)
|
24
|
+
# php
|
25
|
+
cmd = "find . -type f -name '*.php' -exec sed -i '' s/CHANGE_ME/#{@nms}/ {} +"
|
26
|
+
Kernel::system(cmd)
|
27
|
+
# html
|
28
|
+
cmd = "find . -type f -name '*.html' -exec sed -i '' s/CHANGE_ME/#{@nms}/ {} +"
|
29
|
+
Kernel::system(cmd)
|
30
|
+
# tpl
|
31
|
+
cmd = "find . -type f -name '*.tpl' -exec sed -i '' s/CHANGE_ME/#{@nms}/ {} +"
|
32
|
+
Kernel::system(cmd)
|
33
|
+
|
34
|
+
# simon_controller.find_and_replace './app'ateasub01@
|
35
|
+
|
36
|
+
|
37
|
+
choice = choose("Setup Local DB?", :yes, :now)
|
38
|
+
|
39
|
+
if choice === :yes
|
40
|
+
self.msg 'setting up Local DB'
|
41
|
+
end
|
42
|
+
|
43
|
+
self.msg 'Setup complete!'
|
44
|
+
self.complete
|
45
|
+
end
|
46
|
+
|
7
47
|
end
|
data/my-simon.gemspec
CHANGED