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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2210077ec0c7b3d0def8270a6b8b778af3dba460
4
- data.tar.gz: 15011c0daec98a25102da19518cc50fb34031e86
3
+ metadata.gz: 7a60434fd2b6833cf7f36852561010e0152ac5c1
4
+ data.tar.gz: 845d540cd2405d33c811f2a343b780af89cbc0aa
5
5
  SHA512:
6
- metadata.gz: 93fb8c1e3a99c0a7af1766f0ff21ddba4763cbd98b2e2b5a2526937aefb57e31315991aa2a4c89a9c3369f4776a485a46c257ca85ca1c449b0e82ec2ed6435e5
7
- data.tar.gz: 841998856f7b967e9c420de47e755a24b37d6eda51ccf8da4f26985a90452252c0421d4db2f00a874c7e5462043ae2ecac3ebc4ec6645260b160f0e71002181e
6
+ metadata.gz: 982b59aa7413e9735bbbb5729cd12de1a78f9ce317ac8423fb445300820f867f51081946468a24dd7f35b9a06711faca9efa1dd164a8d6510f7e5898f405f308
7
+ data.tar.gz: 0ec7803ac0cf7264fd4204678f5f40f37f736345758337ae0eb38ab5ee585358524c4c1c49660fba683a08d20284a9b4e9ebce4ea81e26175942f1c6ce36d103
data/lib/susanoo/cli.rb CHANGED
@@ -1,7 +1,4 @@
1
1
  require 'rubygems'
2
- require 'bundler/setup'
3
-
4
- Bundler.require
5
2
 
6
3
  require 'pathname'
7
4
  require 'susanoo/cli/global'
@@ -6,7 +6,7 @@ module Susanoo
6
6
  module CLI
7
7
  class Global < Thor
8
8
 
9
- desc "new PROJECT", "Create a new Susanoo/Cordova project"
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
@@ -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
 
@@ -8,7 +8,7 @@ class Susanoo::Application
8
8
  class Assets < Susanoo::Controller
9
9
  def call(env)
10
10
  # Environment is a sprockets environment instance
11
- run environment
11
+ environment.call env
12
12
  end
13
13
 
14
14
  def build(generator, route)
@@ -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 "Java Package Name: ".colorize(:light_green)
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 "Platforms (comma separated): ".colorize(:light_blue)
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 "Adding console plugin to project".colorize(:green)
38
- system "cordova plugin add org.apache.cordova.console"
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 "www" do
46
- remove_file "index.html"
47
- remove_file "js"
48
- remove_file "css"
49
- remove_file "img"
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
@@ -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
@@ -1,7 +1,7 @@
1
- require "bundler/setup"
1
+ require 'bundler/setup'
2
2
  Bundler.require
3
3
 
4
- require "susanoo/tasks"
4
+ require 'susanoo/tasks'
5
5
  Susanoo::Tasks.load_tasks
6
6
 
7
7
  task :default => :assets
@@ -1,3 +1,5 @@
1
+ # If you need to use your own controllers
2
+ # define them in your `lib` and require them here
1
3
  ROUTER = Lotus::Router.new do
2
4
  get '/', to: Susanoo::Application::Index
3
5
  get '/views/*', to: Susanoo::Application::Views
@@ -0,0 +1,3 @@
1
+ module <%= Susanoo::Project.folder_name.camelize %>
2
+
3
+ end
@@ -1,3 +1,3 @@
1
1
  module Susanoo
2
- VERSION = '0.10.0'
2
+ VERSION = '0.11.1'
3
3
  end
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.10.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-10 00:00:00.000000000 Z
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