susanoo 0.10.0 → 0.11.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/susanoo/cli.rb +0 -3
- data/lib/susanoo/cli/global.rb +1 -1
- data/lib/susanoo/cli/project.rb +10 -1
- data/lib/susanoo/controllers/assets.rb +1 -1
- data/lib/susanoo/generators/cordova.rb +9 -9
- data/lib/susanoo/generators/frameworks.rb +1 -0
- data/lib/susanoo/irb.rb +27 -0
- data/lib/susanoo/templates/application/Rakefile +2 -2
- data/lib/susanoo/templates/application/config/routes.rb +2 -0
- data/lib/susanoo/templates/application/lib/app_module.rb.erb +3 -0
- data/lib/susanoo/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7a60434fd2b6833cf7f36852561010e0152ac5c1
|
4
|
+
data.tar.gz: 845d540cd2405d33c811f2a343b780af89cbc0aa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 982b59aa7413e9735bbbb5729cd12de1a78f9ce317ac8423fb445300820f867f51081946468a24dd7f35b9a06711faca9efa1dd164a8d6510f7e5898f405f308
|
7
|
+
data.tar.gz: 0ec7803ac0cf7264fd4204678f5f40f37f736345758337ae0eb38ab5ee585358524c4c1c49660fba683a08d20284a9b4e9ebce4ea81e26175942f1c6ce36d103
|
data/lib/susanoo/cli.rb
CHANGED
data/lib/susanoo/cli/global.rb
CHANGED
@@ -6,7 +6,7 @@ module Susanoo
|
|
6
6
|
module CLI
|
7
7
|
class Global < Thor
|
8
8
|
|
9
|
-
desc
|
9
|
+
desc 'new PROJECT', 'Create a new Susanoo/Cordova project'
|
10
10
|
def new(name)
|
11
11
|
Susanoo::Project.folder_name = name
|
12
12
|
Susanoo::Generators::Cordova.start
|
data/lib/susanoo/cli/project.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
require 'thor'
|
2
2
|
require 'susanoo/generators'
|
3
|
-
|
3
|
+
require 'susanoo/irb'
|
4
4
|
|
5
5
|
module Susanoo
|
6
6
|
module CLI
|
@@ -15,6 +15,7 @@ module Susanoo
|
|
15
15
|
map 'r' => :run_in
|
16
16
|
map 'd' => :destroy
|
17
17
|
map 'b' => :build
|
18
|
+
map 'c' => :console
|
18
19
|
|
19
20
|
# Set the project root
|
20
21
|
def self.root=(path)
|
@@ -111,6 +112,14 @@ module Susanoo
|
|
111
112
|
end
|
112
113
|
end
|
113
114
|
|
115
|
+
desc 'console', 'Run pry in environment of `Susanoo`. '
|
116
|
+
def console
|
117
|
+
project_root = Susanoo::Project.path
|
118
|
+
require File.join(project_root, 'config/routes')
|
119
|
+
|
120
|
+
IRB.start_session(binding)
|
121
|
+
end
|
122
|
+
|
114
123
|
private
|
115
124
|
# Private ---------------------------
|
116
125
|
|
@@ -10,7 +10,7 @@ module Susanoo
|
|
10
10
|
fname = Susanoo::Project.folder_name.dup
|
11
11
|
|
12
12
|
# Java Package name
|
13
|
-
package_name = ask
|
13
|
+
package_name = ask 'Java Package Name: '.colorize(:light_green)
|
14
14
|
if package_name.chomp.strip.empty?
|
15
15
|
package_name = "com.example.#{fname.gsub("-", "_")}"
|
16
16
|
else
|
@@ -28,25 +28,25 @@ module Susanoo
|
|
28
28
|
end
|
29
29
|
|
30
30
|
def platforms
|
31
|
-
platforms = ask
|
31
|
+
platforms = ask 'Platforms (comma separated): '.colorize(:light_blue)
|
32
32
|
inside Susanoo::Project.folder_name do
|
33
33
|
platforms.chomp.split(",").each do |platform|
|
34
34
|
say "Adding #{platform.strip} platform ...".colorize(:green)
|
35
35
|
system "cordova platform add #{platform.strip}"
|
36
36
|
end
|
37
|
-
say
|
38
|
-
system
|
37
|
+
say 'Adding console plugin to project'.colorize(:green)
|
38
|
+
system 'cordova plugin add org.apache.cordova.console'
|
39
39
|
end
|
40
40
|
end
|
41
41
|
|
42
42
|
def remove_default_files
|
43
43
|
say "Removing cordova default files . . .".colorize(:yellow)
|
44
44
|
inside Susanoo::Project.folder_name do
|
45
|
-
inside
|
46
|
-
remove_file
|
47
|
-
remove_file
|
48
|
-
remove_file
|
49
|
-
remove_file
|
45
|
+
inside 'www' do
|
46
|
+
remove_file 'index.html'
|
47
|
+
remove_file 'js'
|
48
|
+
remove_file 'css'
|
49
|
+
remove_file 'img'
|
50
50
|
end
|
51
51
|
end
|
52
52
|
end
|
@@ -42,6 +42,7 @@ module Susanoo
|
|
42
42
|
directory 'config', "#{Susanoo::Project.folder_name}/config"
|
43
43
|
template '.gitignore', "#{Susanoo::Project.folder_name}/.gitignore"
|
44
44
|
template 'bin/susanoo', "#{Susanoo::Project.folder_name}/bin/susanoo"
|
45
|
+
template 'lib/app_module.rb.erb', "#{Susanoo::Project.folder_name}/lib/#{Susanoo::Project.folder_name}.rb"
|
45
46
|
end
|
46
47
|
|
47
48
|
def bower_install
|
data/lib/susanoo/irb.rb
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'irb'
|
2
|
+
|
3
|
+
# IRB module which is responsible to embed
|
4
|
+
# `irb` in `Susanoo` projects
|
5
|
+
module IRB
|
6
|
+
# Start the `irb` session in given `binding`
|
7
|
+
def self.start_session(binding)
|
8
|
+
unless @__initialized
|
9
|
+
args = ARGV
|
10
|
+
ARGV.replace(ARGV.dup)
|
11
|
+
IRB.setup(nil)
|
12
|
+
ARGV.replace(args)
|
13
|
+
@__initialized = true
|
14
|
+
end
|
15
|
+
|
16
|
+
workspace = WorkSpace.new(binding)
|
17
|
+
|
18
|
+
irb = Irb.new(workspace)
|
19
|
+
|
20
|
+
@CONF[:IRB_RC].call(irb.context) if @CONF[:IRB_RC]
|
21
|
+
@CONF[:MAIN_CONTEXT] = irb.context
|
22
|
+
|
23
|
+
catch(:IRB_EXIT) do
|
24
|
+
irb.eval_input
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
data/lib/susanoo/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: susanoo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.11.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sameer Rahmani
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-09-
|
11
|
+
date: 2014-09-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -271,6 +271,7 @@ files:
|
|
271
271
|
- lib/susanoo/generators/ng_directive.rb
|
272
272
|
- lib/susanoo/generators/ng_module.rb
|
273
273
|
- lib/susanoo/generators/scaffold.rb
|
274
|
+
- lib/susanoo/irb.rb
|
274
275
|
- lib/susanoo/project.rb
|
275
276
|
- lib/susanoo/static_generator.rb
|
276
277
|
- lib/susanoo/tasks.rb
|
@@ -281,6 +282,7 @@ files:
|
|
281
282
|
- lib/susanoo/templates/application/Rakefile
|
282
283
|
- lib/susanoo/templates/application/bin/susanoo
|
283
284
|
- lib/susanoo/templates/application/config/routes.rb
|
285
|
+
- lib/susanoo/templates/application/lib/app_module.rb.erb
|
284
286
|
- lib/susanoo/templates/application/src/assets/javascripts/app.js
|
285
287
|
- lib/susanoo/templates/application/src/assets/javascripts/application.js
|
286
288
|
- lib/susanoo/templates/application/src/assets/javascripts/functions.js
|