sencha-touch-rails 2.0.1 → 2.0.2

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: b76a77600449c8b53f45abf3c061779900239dd3
4
- data.tar.gz: 8743dfc64647e0fd31240fd59781b9079846aca6
3
+ metadata.gz: c0dd4113613280b54aacf576e3ceea802fccafc7
4
+ data.tar.gz: 05b461c84ab7f69dc508da598ea58339ac16830e
5
5
  SHA512:
6
- metadata.gz: d6b18183c4619dea5679eb4aed2d8254e283d92bdc3d6af0940cc31f2379d0c62ff35ca8007bbd1605e93734f3ecddb5e609fe9817c1c28f2b29284fcaaadb28
7
- data.tar.gz: 54dab1382da842ace6bce118a66340e22d888a3c9c93398c3a7e961d6101fecdbe213ae47cee9010f5c0c12ac657f3938aec1bc6e9582427f4a618fe04f73403
6
+ metadata.gz: ec71231af58e9189bbe947892871ba3aa5ddf7284731536563460a7f02cc17413e6218d7f3db0f2ab25af38e3e3b5319272e58bbfd15ef832f6b155bd18d3ec6
7
+ data.tar.gz: b64dc5f008ca4ca08600827e446c142a22e849c14ced17b1e4db789d4ab63f6f4f1848a0b1011b8df0eebe853309101aac90d5c9a67f4aaab9af22a38e9e4647
@@ -1,3 +1,6 @@
1
+ ## 2.0.2
2
+ - Configurable assets path
3
+
1
4
  ## 2.0.1
2
5
  - Include alternative mappings
3
6
 
@@ -28,12 +28,12 @@ def download_sencha_touch(sencha_touch_zip=nil)
28
28
  }
29
29
  end
30
30
  }
31
- FileUtils.mv "sencha-touch/touch-2.4.1/src","../vendor/assets/javascripts/sencha-touch"
32
- FileUtils.mv "sencha-touch/touch-2.4.1/resources/themes/stylesheets/sencha-touch","../vendor/assets/stylesheets/sencha-touch"
33
- FileUtils.mv "sencha-touch/touch-2.4.1/resources/sass", "../vendor/assets/stylesheets/sencha-touch/themes"
34
- FileUtils.mv "sencha-touch/touch-2.4.1/resources/themes/fonts", "../vendor/assets/fonts"
35
- FileUtils.mv "sencha-touch/touch-2.4.1/resources/themes/images", "../vendor/assets/images"
36
- FileUtils.mv "sencha-touch/touch-2.4.1/resources/themes/vendor/compass-recipes", "../vendor/compass-recipes"
31
+ FileUtils.cp_r "sencha-touch/touch-2.4.1/src","../vendor/assets/javascripts/sencha-touch"
32
+ FileUtils.cp_r "sencha-touch/touch-2.4.1/resources/themes/stylesheets/sencha-touch","../vendor/assets/stylesheets/sencha-touch"
33
+ FileUtils.cp_r "sencha-touch/touch-2.4.1/resources/sass", "../vendor/assets/stylesheets/sencha-touch/themes"
34
+ FileUtils.cp_r "sencha-touch/touch-2.4.1/resources/themes/fonts", "../vendor/assets/fonts"
35
+ FileUtils.cp_r "sencha-touch/touch-2.4.1/resources/themes/images", "../vendor/assets/images"
36
+ FileUtils.cp_r "sencha-touch/touch-2.4.1/resources/themes/vendor/compass-recipes", "../vendor/compass-recipes"
37
37
  FileUtils.mv [
38
38
  "sencha-touch/touch-2.4.1/sencha-touch-all-debug.js",
39
39
  "sencha-touch/touch-2.4.1/sencha-touch-all.js",
@@ -0,0 +1,12 @@
1
+ require 'generators/sencha/generator_base'
2
+ module Sencha
3
+ class ControllerGenerator < Rails::Generators::NamedBase
4
+ include Sencha::GeneratorBase
5
+
6
+ def generate_controller
7
+ p "sencha_controller_class #{sencha_controller_class}"
8
+ p "sencha_controller_full_class #{sencha_controller_full_class}"
9
+ p "sencha_controller_file #{sencha_controller_file}"
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,54 @@
1
+ module Sencha
2
+ module GeneratorBase
3
+ extend ActiveSupport::Concern
4
+
5
+ included do
6
+ #argument :attributes, type: :array, default: []
7
+ source_root File.expand_path("../templates", __FILE__)
8
+ end
9
+
10
+ def app_name
11
+ application_name.humanize
12
+ end
13
+
14
+ def sencha_model_class
15
+ human_name.singularize
16
+ end
17
+ def sencha_model_full_class
18
+ [app_name, :model, class_path, sencha_model_class].flatten.join(".")
19
+ end
20
+ def sencha_model_file
21
+ [:app, :assets, :javascripts, :model, class_path, sencha_model_class].flatten.join("/") << '.coffee'
22
+ end
23
+
24
+ def sencha_view_class
25
+ human_name.pluralize
26
+ end
27
+ def sencha_view_full_class
28
+ [app_name, :view, class_path, sencha_view_class].flatten.join(".")
29
+ end
30
+ def sencha_view_file
31
+ [:app, :assets, :javascripts, :view, class_path, sencha_view_class].flatten.join("/") << '.coffee'
32
+ end
33
+
34
+ def sencha_store_class
35
+ [human_name.pluralize, :Store].join
36
+ end
37
+ def sencha_store_full_class
38
+ [app_name, :store, class_path, sencha_store_class].flatten.join(".")
39
+ end
40
+ def sencha_store_file
41
+ [:app, :assets, :javascripts, :store, class_path, sencha_store_class].flatten.join("/") << '.coffee'
42
+ end
43
+
44
+ def sencha_controller_class
45
+ [human_name.pluralize, :Ctrl].join
46
+ end
47
+ def sencha_controller_full_class
48
+ [app_name, :controller, class_path, sencha_controller_class].flatten.join(".")
49
+ end
50
+ def sencha_controller_file
51
+ [:app, :assets, :javascripts, :controller, class_path, sencha_controller_class].flatten.join("/") << '.coffee'
52
+ end
53
+ end
54
+ end
@@ -0,0 +1,12 @@
1
+ require 'generators/sencha/generator_base'
2
+ module Sencha
3
+ class ModelGenerator < Rails::Generators::NamedBase
4
+ include Sencha::GeneratorBase
5
+
6
+ def generate_model
7
+ p "sencha_model_class #{sencha_model_class}"
8
+ p "sencha_model_full_class #{sencha_model_full_class}"
9
+ p "sencha_model_file #{sencha_model_file}"
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,13 @@
1
+ require 'generators/sencha/generator_base'
2
+ module Sencha
3
+ class ScaffoldGenerator < Rails::Generators::NamedBase
4
+ include Sencha::GeneratorBase
5
+
6
+ def generate_scaffold
7
+ invoke "sencha:model", [name]
8
+ invoke "sencha:view", [name]
9
+ invoke "sencha:controller", [name]
10
+ invoke "sencha:store", [name]
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,12 @@
1
+ require 'generators/sencha/generator_base'
2
+ module Sencha
3
+ class StoreGenerator < Rails::Generators::NamedBase
4
+ include Sencha::GeneratorBase
5
+
6
+ def generate_store
7
+ p "sencha_store_class #{sencha_store_class}"
8
+ p "sencha_store_full_class #{sencha_store_full_class}"
9
+ p "sencha_store_file #{sencha_store_file}"
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,6 @@
1
+ Ext.define '<%= sencha_model_full_class %>',
2
+ extend: 'Ext.data.Model'
3
+ config:
4
+ fields: [
5
+ <%= field_pairs(" ") %>
6
+ ]
@@ -0,0 +1,10 @@
1
+ Ext.define '<%= sencha_store_full_class %>',
2
+ extend: ['Ext.data.proxy.Rest', 'Ext.data.Store']
3
+ requires: '<%= sencha_model_full_class %>'
4
+ config:
5
+ model: '<%= sencha_model_full_class %>'
6
+ proxy:
7
+ type: 'rest'
8
+ url: '<%= sencha_store_path %>'
9
+ reader: 'json'
10
+ writer: 'json'
@@ -0,0 +1,12 @@
1
+ require 'generators/sencha/generator_base'
2
+ module Sencha
3
+ class ViewGenerator < Rails::Generators::NamedBase
4
+ include Sencha::GeneratorBase
5
+
6
+ def generate_view
7
+ p "sencha_view_class #{sencha_view_class}"
8
+ p "sencha_view_full_class #{sencha_view_full_class}"
9
+ p "sencha_view_file #{sencha_view_file}"
10
+ end
11
+ end
12
+ end
@@ -2,5 +2,6 @@ module SenchaTouch
2
2
  module Rails
3
3
  require 'sencha-touch/rails/engine'
4
4
  require 'sencha-touch/rails/version'
5
+ require 'sencha-touch/rails/template'
5
6
  end
6
7
  end
@@ -1,4 +1,6 @@
1
- # Configure Rails 3.1 to have assert_select_jquery() in tests
1
+ require 'sprockets'
2
+ require 'sprockets/engines'
3
+
2
4
  module SenchaTouch
3
5
  module Rails
4
6
  class Engine < ::Rails::Engine
@@ -6,7 +8,8 @@ module SenchaTouch
6
8
  app.config.assets.paths << "#{Gem.loaded_specs['compass-core'].full_gem_path}/stylesheets"
7
9
  app.config.assets.paths << "#{Gem.loaded_specs['compass-blueprint'].full_gem_path}/framework/blueprint/stylesheets"
8
10
  app.config.assets.paths << root.join("vendor", "compass-recipes", "stylesheets")
11
+ app.assets.register_engine '.sencha', SenchaTouch::Rails::Template
9
12
  end
10
13
  end
11
14
  end
12
- end
15
+ end
@@ -0,0 +1,17 @@
1
+ module SenchaTouch
2
+ module Rails
3
+ class Template < ::Tilt::Template
4
+ def prepare
5
+ # Do any initialization here
6
+ p "STR prepare"
7
+ end
8
+
9
+ # Adds a "!" to original template.
10
+ def evaluate(scope, locals, &block)
11
+ p "STR evaluate"
12
+ #scope.require_asset "sencha-touch/form/FieldSet"
13
+ data
14
+ end
15
+ end
16
+ end
17
+ end
@@ -1,6 +1,6 @@
1
1
  module SenchaTouch
2
2
  module Rails
3
- VERSION = "2.0.1"
3
+ VERSION = "2.0.2"
4
4
  SENCHA_TOUCH_VERSION = "2.4.1 GPL"
5
5
  end
6
6
  end
@@ -22,5 +22,6 @@ Gem::Specification.new do |s|
22
22
  s.extensions = 'ext/mkrf_conf.rb'
23
23
  s.require_path = 'lib'
24
24
 
25
- s.add_development_dependency "rubyzip"
25
+ s.add_dependency "rubyzip"
26
+ s.add_dependency "thor"
26
27
  end
@@ -1726,5 +1726,5 @@ Ext.ClassManager.addNameAliasMappings({
1726
1726
  });
1727
1727
 
1728
1728
  Ext.Loader.setPath({
1729
- 'Ext': 'assets/sencha-touch'
1730
- });
1729
+ 'Ext': '<%= Rails.configuration.assets.prefix %>/sencha-touch'
1730
+ });
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sencha-touch-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 2.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Vangelov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-30 00:00:00.000000000 Z
11
+ date: 2015-06-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: compass
@@ -45,7 +45,21 @@ dependencies:
45
45
  - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
- type: :development
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: thor
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :runtime
49
63
  prerelease: false
50
64
  version_requirements: !ruby/object:Gem::Requirement
51
65
  requirements:
@@ -71,13 +85,22 @@ files:
71
85
  - bin/download_sencha_touch.rb
72
86
  - ext/mkrf_conf.rb
73
87
  - lib/compass_config.rb
88
+ - lib/generators/sencha/controller_generator.rb
89
+ - lib/generators/sencha/generator_base.rb
90
+ - lib/generators/sencha/model_generator.rb
91
+ - lib/generators/sencha/scaffold_generator.rb
92
+ - lib/generators/sencha/store_generator.rb
93
+ - lib/generators/sencha/templates/model.erb.coffee
94
+ - lib/generators/sencha/templates/store.erb.coffee
95
+ - lib/generators/sencha/view_generator.rb
74
96
  - lib/sencha-touch-rails.rb
75
97
  - lib/sencha-touch/rails.rb
76
98
  - lib/sencha-touch/rails/engine.rb
99
+ - lib/sencha-touch/rails/template.rb
77
100
  - lib/sencha-touch/rails/version.rb
78
101
  - lib/theme_images.rb
79
102
  - sencha-touch-rails.gemspec
80
- - vendor/assets/javascripts/sencha-touch-rails.js
103
+ - vendor/assets/javascripts/sencha-touch-rails.js.erb
81
104
  - vendor/assets/stylesheets/sencha-touch-rails.scss
82
105
  homepage: http://rubygems.org/gems/sencha-touch-rails
83
106
  licenses:
@@ -100,7 +123,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
100
123
  version: 1.3.6
101
124
  requirements: []
102
125
  rubyforge_project: sencha-touch-rails
103
- rubygems_version: 2.4.5
126
+ rubygems_version: 2.4.6
104
127
  signing_key:
105
128
  specification_version: 4
106
129
  summary: Using Sencha Touch with Rails