netzke-core 0.9.0.rc1 → 0.9.0
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/CHANGELOG.md +5 -0
- data/Gemfile +1 -2
- data/README.md +8 -8
- data/Rakefile +1 -1
- data/lib/netzke/base.rb +3 -0
- data/lib/netzke/core/client_class.rb +1 -1
- data/lib/netzke/core/configuration.rb +9 -0
- data/lib/netzke/core/json_literal.rb +4 -0
- data/lib/netzke/core/railz/controller_extensions.rb +1 -1
- data/lib/netzke/core/ruby_ext/hash.rb +2 -2
- data/lib/netzke/core/version.rb +1 -8
- data/lib/netzke/core.rb +2 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3249a1b7bc59b32f5437299a6238d579a51d6f07
|
4
|
+
data.tar.gz: 30539d08f8c08ec64a9a8f0d664fbd323150c47d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 49850df9ba02b6363c8b066254dd463a73e2502d5586b5b3c3fa9fd4705093387677e1524bdd6dd0236c1f1e6281c9d3a57860b7b031b10b6ba0a6daa302ff8f
|
7
|
+
data.tar.gz: 944e0c00f7cc2da75ee4836b5010934a1eb916da91b0f39002eb9c8823d95d0941ae61eca4c63bb26b7c96a2c9b430e4f32b3de8829ee88d8e5f04d0cad13258
|
data/CHANGELOG.md
CHANGED
@@ -1,7 +1,12 @@
|
|
1
1
|
# v0.9.0 - WIP
|
2
|
+
* Fix icon detection
|
3
|
+
* Introduce `Base#validate_config` that can be overridden to validate a component's configuration
|
4
|
+
|
5
|
+
# v0.9.0.rc1 - 2013-12-01
|
2
6
|
* Rails 4
|
3
7
|
* Ext JS 4.2
|
4
8
|
* Ext JS Neptune scheme is default
|
9
|
+
* Default icon location changed to `/assets/icons`
|
5
10
|
|
6
11
|
# v0.8.4 - 2013-05-22
|
7
12
|
* bug fix
|
data/Gemfile
CHANGED
@@ -2,8 +2,6 @@ source 'http://rubygems.org'
|
|
2
2
|
|
3
3
|
gemspec
|
4
4
|
|
5
|
-
gem 'netzke-testing'
|
6
|
-
|
7
5
|
# For local development
|
8
6
|
# gem 'netzke_testing', path: '~/code/netzke/netzke_testing'
|
9
7
|
|
@@ -13,4 +11,5 @@ group :test do
|
|
13
11
|
gem 'database_cleaner'
|
14
12
|
gem 'rspec-rails'
|
15
13
|
gem 'pry-rails'
|
14
|
+
gem 'netzke-testing', '~>0.10.0'
|
16
15
|
end
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Netzke Core [](http://badge.fury.io/rb/netzke-core) [](http://badge.fury.io/rb/netzke-core) [](https://travis-ci.org/netzke/netzke-core) [](https://codeclimate.com/github/netzke/netzke-core)
|
2
2
|
|
3
3
|
[RDocs](http://rdoc.info/projects/netzke/netzke-core)
|
4
4
|
|
@@ -299,7 +299,7 @@ For more details on client-server communication see [Netzke::Core::Services]("ht
|
|
299
299
|
|
300
300
|
## Icons support
|
301
301
|
|
302
|
-
Netzke can optionally make use of icons for making clickable elements like buttons and menu items more visual. The icons should be (by default) located in `
|
302
|
+
Netzke can optionally make use of icons for making clickable elements like buttons and menu items more visual. The icons should be (by default) located in `app/assets/images/icons`.
|
303
303
|
|
304
304
|
An example of specifying an icon for an action:
|
305
305
|
|
@@ -309,7 +309,7 @@ action :logout do |c|
|
|
309
309
|
end
|
310
310
|
```
|
311
311
|
|
312
|
-
The logout action will be configured with `public/
|
312
|
+
The logout action will be configured with `public/assets/icons/door.png` as icon.
|
313
313
|
|
314
314
|
For more details on using icons refer to [Netzke::Core::Actions]("http://rdoc.info/github/netzke/netzke-core/Netzke/Core/Actions").
|
315
315
|
|
@@ -325,7 +325,7 @@ Netzke provides support for HAML templates in case you don't want to put HTML in
|
|
325
325
|
|
326
326
|
## Requirements
|
327
327
|
|
328
|
-
* Ruby
|
328
|
+
* Ruby >= 1.9.3
|
329
329
|
* Rails ~> 3.2.0
|
330
330
|
* Ext JS ~> 4.2.0
|
331
331
|
|
@@ -349,13 +349,13 @@ By default, Netzke assumes that your Ext JS library is located in `public/extjs`
|
|
349
349
|
|
350
350
|
The bundled `spec/rails_app` application used for automated testing can be easily run as a stand-alone Rails app. It's a good source of concise, focused examples. After starting the application, access any of the test components (located in `spec/rails_app/app/components`) by using the following url:
|
351
351
|
|
352
|
-
http://localhost:3000/components/{name of the component's class}
|
352
|
+
http://localhost:3000/netzke/components/{name of the component's class}
|
353
353
|
|
354
|
-
For example [http://localhost:3000/components/Endpoints](http://localhost:3000/components/Endpoints)
|
354
|
+
For example [http://localhost:3000/netzke/components/Endpoints](http://localhost:3000/netzke/components/Endpoints)
|
355
355
|
|
356
356
|
To run a specific Mocha JS spec (located in `spec/mocha`) for a component, append `?spec={name of spec}`, for example:
|
357
357
|
|
358
|
-
[http://localhost:3000/components/Endpoints?spec=endpoints](http://localhost:3000/components/Endpoints?spec=endpoints)
|
358
|
+
[http://localhost:3000/netzke/components/Endpoints?spec=endpoints](http://localhost:3000/components/Endpoints?spec=endpoints)
|
359
359
|
|
360
360
|
To run all the tests (from the gem's root):
|
361
361
|
|
@@ -369,7 +369,7 @@ This assumes that the Ext JS library is located/symlinked in `spec/rails_app/pub
|
|
369
369
|
|
370
370
|
Help developing Netzke by submitting a pull request when you think others can benefit from it.
|
371
371
|
|
372
|
-
If you feel particularily generous, you can
|
372
|
+
If you feel particularily generous, you can support the author by donating a couple bucks a week at [GitTip](https://www.gittip.com/uptomax).
|
373
373
|
|
374
374
|
## Useful links
|
375
375
|
|
data/Rakefile
CHANGED
@@ -8,7 +8,7 @@ Dir[File.join(File.dirname(__FILE__), './lib/tasks/*.rake')].each { |file| load
|
|
8
8
|
Dir[File.join(File.dirname(__FILE__), 'tasks/*.rake')].each { |file| load file }
|
9
9
|
|
10
10
|
YARD::Rake::YardocTask.new do |t|
|
11
|
-
t.options = ['--title', "Netzke Core #{Netzke::Core::
|
11
|
+
t.options = ['--title', "Netzke Core #{Netzke::Core::VERSION}"]
|
12
12
|
end
|
13
13
|
|
14
14
|
namespace :yard do
|
data/lib/netzke/base.rb
CHANGED
@@ -63,7 +63,7 @@ module Netzke
|
|
63
63
|
def method_missing(name, *args)
|
64
64
|
if name =~ /(.+)=$/
|
65
65
|
value = args.first
|
66
|
-
@properties[$1.to_sym] = value.is_a?(String) && value =~ /^\s*function/ ?
|
66
|
+
@properties[$1.to_sym] = value.is_a?(String) && value =~ /^\s*function/ ? Netzke::Core::JsonLiteral.new(value) : value
|
67
67
|
else
|
68
68
|
@properties[name.to_sym]
|
69
69
|
end
|
@@ -61,6 +61,15 @@ module Netzke::Core
|
|
61
61
|
|
62
62
|
protected
|
63
63
|
|
64
|
+
# Override to validate configuration and raise eventual exceptions
|
65
|
+
# E.g.:
|
66
|
+
#
|
67
|
+
# def validate_config(c)
|
68
|
+
# raise ArgumentError, "Grid requires a model" if c.model.nil?
|
69
|
+
# end
|
70
|
+
def validate_config(c)
|
71
|
+
end
|
72
|
+
|
64
73
|
# During the normalization of config object, +extend_item+ is being called with each item found (recursively) in there.
|
65
74
|
# For example, symbols representing nested child components get replaced with a proper config hash, same goes for actions (see +Composition+ and +Actions+ respectively).
|
66
75
|
# Override to do any additional checks/enhancements. See, for example, +Netzke::Basepack::WrapLazyLoaded+ or +Netzke::Basepack::Fields+.
|
@@ -97,7 +97,7 @@ module Netzke
|
|
97
97
|
tid: request.tid,
|
98
98
|
action: component_name,
|
99
99
|
method: request.endpoint,
|
100
|
-
result:
|
100
|
+
result: Netzke::Core::JsonLiteral.new(endpoint_response.netzke_jsonify.to_json)
|
101
101
|
}
|
102
102
|
end
|
103
103
|
|
@@ -9,7 +9,7 @@ class Hash
|
|
9
9
|
|
10
10
|
def netzke_jsonify
|
11
11
|
self.inject({}) do |h,(k,v)|
|
12
|
-
new_key = if k.is_a?(
|
12
|
+
new_key = if k.is_a?(Netzke::Core::JsonLiteral)
|
13
13
|
k
|
14
14
|
elsif k.is_a?(String)
|
15
15
|
k.camelize(:lower)
|
@@ -35,7 +35,7 @@ class Hash
|
|
35
35
|
end
|
36
36
|
|
37
37
|
def netzke_literalize_keys
|
38
|
-
netzke_update_keys{ |k|
|
38
|
+
netzke_update_keys{ |k| Netzke::Core::JsonLiteral.new(k.to_s) }
|
39
39
|
self
|
40
40
|
end
|
41
41
|
end
|
data/lib/netzke/core/version.rb
CHANGED
data/lib/netzke/core.rb
CHANGED
@@ -6,7 +6,7 @@ module Netzke
|
|
6
6
|
# You can configure Netzke::Core like this:
|
7
7
|
#
|
8
8
|
# Netzke::Core.setup do |config|
|
9
|
-
# config.
|
9
|
+
# config.ext_path = "/home/netzke/ext-4.1.1"
|
10
10
|
# config.icons_uri = "/images/famfamfam/icons"
|
11
11
|
# # ...
|
12
12
|
# end
|
@@ -25,6 +25,7 @@ module Netzke
|
|
25
25
|
autoload :ClientClass, 'netzke/core/client_class'
|
26
26
|
autoload :CssConfig, 'netzke/core/css_config'
|
27
27
|
autoload :ConfigToDslDelegator, 'netzke/core/config_to_dsl_delegator'
|
28
|
+
autoload :JsonLiteral, 'netzke/core/json_literal'
|
28
29
|
|
29
30
|
# :ext (or :touch - when and if ever implemented)
|
30
31
|
mattr_accessor :platform
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: netzke-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.0
|
4
|
+
version: 0.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Max Gorin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-02-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: uglifier
|
@@ -58,14 +58,14 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - ~>
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
61
|
+
version: 3.2.0
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - ~>
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
68
|
+
version: 3.2.0
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: sqlite3
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -162,6 +162,7 @@ files:
|
|
162
162
|
- lib/netzke/core/endpoint_response.rb
|
163
163
|
- lib/netzke/core/html.rb
|
164
164
|
- lib/netzke/core/javascript.rb
|
165
|
+
- lib/netzke/core/json_literal.rb
|
165
166
|
- lib/netzke/core/panel.rb
|
166
167
|
- lib/netzke/core/plugins.rb
|
167
168
|
- lib/netzke/core/railz/action_view_ext/ext.rb
|