netzke 0.12.0 → 1.0.0.0.pre

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -7,7 +7,9 @@ Gemfile.lock
7
7
  InstalledFiles
8
8
  _yardoc
9
9
  coverage
10
- doc/
10
+ doc/client/netzke-*
11
+ doc/client/build
12
+ doc/client/.yuidocs
11
13
  lib/bundler/man
12
14
  pkg
13
15
  rdoc
data/README.md CHANGED
@@ -1,34 +1,159 @@
1
1
  Netzke is a framework that greatly facilitates creation of complex [Sencha Ext JS](http://www.sencha.com/products/extjs/) + [Ruby-on-Rails](http://rubyonrails.org/) applications by leveraging a modular, object-oriented approach.
2
2
 
3
+ *Notes on versioning:*
4
+
5
+ * The latest *released* version is: [![Gem Version](https://badge.fury.io/rb/netzke.svg)](https://badge.fury.io/rb/netzke)
6
+ * The version under development (master): [version.rb](https://github.com/netzke/netzke/blob/master/lib/netzke/version.rb)
7
+ * For other versions check corresponding [branches](https://github.com/netzke/netzke/branches)
8
+
9
+ ## Rationale
10
+
11
+ [Sencha Ext JS]("http://www.sencha.com/products/extjs") is a powerful front-end framework, which is used for crafting web-apps that give the end user experience similar to that of a desktop application. It has an extensive set of widgets ('components'), and leverages a modular approach to its fullest: a developer can extend components (using Ext JS's own class system), nest components with the help of many powerful layouts, dynamically create and destroy them, etc. The architecture of Ext JS is well thought out and complete.
12
+
13
+ However, with Ext JS being server-agnostic, it is not always a trivial task for a developer to bind Ext JS components to the server-side data *and* application business logic, especially in complex applications. Netzke as the solution that allows you to extend the modular approach to the server side.
14
+
15
+ Netzke Core takes the burden of implementing the following key aspects of the framework:
16
+
17
+ * Client-side (JavaScript) class generation
18
+ * Client-server communication
19
+ * Extendibility of components (with the help of inheritance and mixins)
20
+ * Unlimited nesting (composition)
21
+ * Dynamic component loading
22
+ * Client-side class caching
23
+
24
+ ...and more.
25
+
26
+ All this extremely facilitates building fast, low-traffic, robust, and highly maintainable applications. As a result, your code scales much better in the sense of complexity, compared to using conventional MVC, where developers are pretty much limited with the programming techniques that they can apply.
27
+
28
+ ## HelloWorld component
29
+
30
+ Here's a mini-tutorial on building a simple Netzke component that illustrates client-server communication in Netzke.
31
+
32
+ Ext JS files are not distributed with Netzke, so, make sure that they are located in (or sym-linked as) `YOUR_APP/public/extjs`.
33
+
34
+ In `YOUR_APP/components/hello_world.rb`:
35
+
36
+ ```ruby
37
+ class HelloWorld < Netzke::Base
38
+ # Configure client class
39
+ client_class do |c|
40
+ c.title = "Hello World component"
41
+ end
42
+
43
+ # Actions are used by Ext JS to share functionality and state b/w buttons and menu items
44
+ # The handler for this action should be called netzkeOnPingServer by default
45
+ action :ping_server
46
+
47
+ # Self-configure with a bottom toolbar
48
+ def configure(c)
49
+ super
50
+ c.bbar = [:ping_server] # embed the action into bottom toolbar as a button
51
+ end
52
+
53
+ # Endpoint callable from client class
54
+ endpoint :greet_the_world
55
+ # call client class' method showGreeting
56
+ client.show_greeting("Hello World!")
57
+ end
58
+ end
59
+ ```
60
+
61
+ In `YOUR_APP/components/hello_world/client/hello_world.js` put the client class (JavaScript) methods:
62
+
63
+ ```javascript
64
+ {
65
+ // handler for the ping_server action
66
+ netzkeOnPingServer: function(){
67
+ // calling greet_the_world endpoint
68
+ this.server.greetTheWorld();
69
+ },
70
+
71
+ // called by the server as the result of executing the endpoint
72
+ showGreeting: function(greeting){
73
+ this.update("Server says: " + greeting);
74
+ }
75
+ }
76
+ ```
77
+
78
+ To embed the component in Rails view:
79
+
80
+ Add `netzke` routes:
81
+
82
+ ```ruby
83
+ # in routes.rb
84
+ RailsApp::Application.routes.draw do
85
+ netzke
86
+ ...
87
+ end
88
+ ```
89
+
90
+ Use `load_netzke` in the layout to include Ext JS and Netzke scripts and stylesheets:
91
+
92
+ ```erb
93
+ <!DOCTYPE html>
94
+ <html>
95
+ <head>
96
+ <meta http-equiv="Content-type" content="text/html; charset=utf-8">
97
+ <%= csrf_meta_tag %>
98
+ <%= load_netzke %>
99
+ </head>
100
+ <body>
101
+ <%= yield %>
102
+ </body>
103
+ </html>
104
+ ```
105
+
106
+ Embed the component in the Rails view:
107
+
108
+ ```erb
109
+ <%= netzke :hello_world %>
110
+ ```
111
+
112
+ To further familiarize yourself with Netzke architecture, refer to the [Netzke Core README](https://github.com/netzke/netzke-core).
113
+
114
+ ## Netzke gems
115
+
3
116
  The `netzke` Ruby gem is a meta-gem that has the following framework parts as dependencies:
4
117
 
5
- * [Netzke Core](https://github.com/netzke/netzke-core) - the "bare bones" of the framework. Its README is a must-read for understanding the framework.
118
+ * [Netzke Core](https://github.com/netzke/netzke-core) - the "bare bones" of the framework. Its [README](https://github.com/netzke/netzke-core) is a must-read for understanding the framework.
6
119
  * [Netzke Basepack](https://github.com/netzke/netzke-basepack) - a few feature-packed pre-built components.
7
120
  * [Netzke Testing](https://github.com/netzke/netzke-testing) - a set of helpers that simplify development and testing of Netzke components.
8
121
 
122
+ ## Documentation
123
+
124
+ Netzke components contain both server-side and client-side code, both having API that you will want to use in your code.
125
+ Documentation for the server-side (Ruby) classes is auto-generated (with YARD) and hosted by
126
+ [RubyDoc.info](http://www.rubydoc.info/). Documentation for client-side classes is generated manually with
127
+ [yuidoc](http://yui.github.io/yuidoc/) using scripts provided in this gem; it is hosted [here](http://api.netzke.org/client/).
128
+
129
+ ### Generating documentation for client-side code
130
+
131
+ Symlink Netzke gems (such as netzke-basepack and netzke-core) into the `doc/client` directory, then run
132
+
133
+ rake client_doc:generate
134
+
135
+ The combined docs for all symlinked gems will be generated in `doc/client/build`.
136
+
9
137
  ## Useful links
10
138
 
11
- * [Project website](http://netzke.org) - a place to start
12
- * [Demo](http://netzke-demo.herokuapp.com) - a demo showing off components from Basepack.
13
- * [Yanit](http://yanit.heroku.com) - Yet Another (Netzke) Issue Tracker, a pretty complex demo app that could be easily written in just a few hours.
14
- * [Twitter](https://twitter.com/netzke) - news about Netzke.
139
+ * [Project website](http://netzke.org) - place to start
140
+ * [Demo](http://demo.netzke.org) - demo showing off components from Basepack (browse through demo components and see their source code)
141
+ * [Yanit](http://yanit.netzke.org) - "Yet Another (Netzke) Issue Tracker", a pretty complex demo app that could be easily written in just a few hours
142
+ * [Twitter](https://twitter.com/netzke) - bite-sized announcements about Netzke
15
143
 
16
144
  ## FAQ
17
145
 
18
146
  ### Will I need to write JavaScript while using Netzke?
19
147
 
20
- Yes and no. For developing new components or extending existing ones (e.g. from [Basepack](https://github.com/netzke/netzke-basepack)) you'll most probably need to apply your Sencha Ext JS knowledge (and Netzke isn't supposed to limit you here in any way). However, the idea is that you write JavaScript code only once. After the component is created, use it as if it was a part of some Ruby library. A comparison with Ruby gems that use C extensions is also appropriate here: as some Ruby gems incapsulate C code for you, the same way Netzke components incapsulate JavaScript.
148
+ Yes and no. For developing new components or extending existing ones (e.g. from [Basepack](https://github.com/netzke/netzke-basepack)) you'll most probably need to apply your Sencha Ext JS knowledge (and Netzke isn't supposed to limit you here in any way). However, the idea is that you write JavaScript code only once. After the component is created, use it as if it were a part of some Ruby library. A comparison with Ruby gems that use C extensions is also appropriate here: as some Ruby gems incapsulate C code for you, the same way Netzke components incapsulate JavaScript.
21
149
 
22
150
  ### Why did you choose for Ext JS as front end?
23
151
 
24
- In the current scene, Ext JS is the only library I know of with the architecture consistent, flexible, and complete enough to allow for complex desktop-like web applications.
152
+ In the current scene, Ext JS is the only library I know of that has the architecture consistent, flexible, and complete enough to allow for complex desktop-like web applications.
25
153
 
26
154
  ### When will there be more components available?
27
155
 
28
- Im creating new components according to my own practical needs. As I’ll be getting something generic, I’ll be adding it to netzke-basepack (or to dedicated gems). However, the key idea of Netzke is that it facilitates creating new components which are extremely easy to share, so, anyone can create his own repository of components to share.
156
+ I'm creating new components according to my own practical needs. As soon as get something generic, I might add that to [netzke-basepack](https://github.com/netzke/netzke-basepack) or to a dedicated gem. However, the key idea of Netzke is that it facilitates creating new components which are extremely easy to share, so that anybody could contribute.
29
157
 
30
158
  ---
31
- Copyright (c) 2008-2015 [Max Gorin](https://twitter.com/mxgrn), released under the MIT license (see LICENSE).
32
-
33
- **Note** that Ext JS is licensed [differently](http://www.sencha.com/products/extjs/license/), and you may need to purchase a commercial license in order to use it in your projects!
34
-
159
+ Copyright (c) 2009-2015 [Good Bit Labs](http://goodbitlabs.com/), released under the GPLv3 license
data/Rakefile CHANGED
@@ -1 +1,26 @@
1
1
  require "bundler/gem_tasks"
2
+
3
+ CLIENT_DOC = "doc/client"
4
+
5
+ require_relative "#{CLIENT_DOC}/netzke-core/lib/netzke/core/version"
6
+ require_relative "#{CLIENT_DOC}/netzke-basepack/lib/netzke/basepack/version"
7
+
8
+ namespace :client_doc do
9
+ desc "Generate client-side docs"
10
+ task :generate do
11
+ version = "Core #{Netzke::Core::VERSION}, Basepack #{Netzke::Basepack::VERSION}"
12
+ puts "Generating client-side docs #{version}..."
13
+ `rm -rf doc/client/build`
14
+ `yuidoc #{CLIENT_DOC} --project-version "#{version}"`
15
+ end
16
+
17
+ desc "Publish client-side docs"
18
+ task publish: :generate do
19
+ server = "netzke.com"
20
+ dir = 'www/api.netzke.org/client'
21
+ puts "Publishing to #{server}:/home/mxgrn/#{dir}..."
22
+ `ssh #{server} "mkdir -p #{dir}"`
23
+ `rsync -r #{CLIENT_DOC}/build/* #{server}:#{dir}`
24
+ puts "Done"
25
+ end
26
+ end
File without changes
@@ -1,3 +1,3 @@
1
1
  module Netzke
2
- VERSION = "0.12.0"
2
+ VERSION = "1.0.0.0.pre"
3
3
  end
@@ -1,4 +1,3 @@
1
- # coding: utf-8
2
1
  lib = File.expand_path('../lib', __FILE__)
3
2
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
3
  require 'netzke/version'
@@ -12,16 +11,15 @@ Gem::Specification.new do |spec|
12
11
  spec.summary = "Client-server GUI components with Sencha Ext JS and Ruby on Rails"
13
12
  spec.description = "Build complex web UI in a modular way"
14
13
  spec.homepage = "http://netzke.org"
15
- spec.license = "MIT"
16
14
 
17
15
  spec.files = `git ls-files -z`.split("\x0")
18
16
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
19
17
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
20
18
  spec.require_paths = ["lib"]
21
19
 
22
- spec.add_dependency "netzke-core", "~>0.12.0"
23
- spec.add_dependency "netzke-basepack", "~>0.12.0"
24
- spec.add_dependency "netzke-testing", "~>0.12.0"
20
+ spec.add_dependency "netzke-core", "1.0.0.0.pre"
21
+ spec.add_dependency "netzke-basepack", "1.0.0.0.pre"
22
+ spec.add_dependency "netzke-testing", "1.0.0.0.pre"
25
23
 
26
24
  spec.add_development_dependency "bundler", "~> 1.5"
27
25
  spec.add_development_dependency "rake"
@@ -0,0 +1,10 @@
1
+ {
2
+ "name": "Netzke",
3
+ "description": "Client-server components with Ext JS and Rails",
4
+ "logo": "http://netzke.org/images/full-logo-h30.png",
5
+ "url": "http://netzke.org",
6
+ "options": {
7
+ "exclude": "doc/client/netzke-core/spec/rails_app/public/extjs,doc/client/netzke-basepack/spec/rails_app/public/extjs",
8
+ "outdir": "doc/client/build"
9
+ }
10
+ }
metadata CHANGED
@@ -1,83 +1,94 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: netzke
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.0
4
+ version: 1.0.0.0.pre
5
+ prerelease: 8
5
6
  platform: ruby
6
7
  authors:
7
8
  - Max Gorin
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2015-03-18 00:00:00.000000000 Z
12
+ date: 2015-12-28 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: netzke-core
15
16
  requirement: !ruby/object:Gem::Requirement
17
+ none: false
16
18
  requirements:
17
- - - "~>"
19
+ - - '='
18
20
  - !ruby/object:Gem::Version
19
- version: 0.12.0
21
+ version: 1.0.0.0.pre
20
22
  type: :runtime
21
23
  prerelease: false
22
24
  version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
23
26
  requirements:
24
- - - "~>"
27
+ - - '='
25
28
  - !ruby/object:Gem::Version
26
- version: 0.12.0
29
+ version: 1.0.0.0.pre
27
30
  - !ruby/object:Gem::Dependency
28
31
  name: netzke-basepack
29
32
  requirement: !ruby/object:Gem::Requirement
33
+ none: false
30
34
  requirements:
31
- - - "~>"
35
+ - - '='
32
36
  - !ruby/object:Gem::Version
33
- version: 0.12.0
37
+ version: 1.0.0.0.pre
34
38
  type: :runtime
35
39
  prerelease: false
36
40
  version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
37
42
  requirements:
38
- - - "~>"
43
+ - - '='
39
44
  - !ruby/object:Gem::Version
40
- version: 0.12.0
45
+ version: 1.0.0.0.pre
41
46
  - !ruby/object:Gem::Dependency
42
47
  name: netzke-testing
43
48
  requirement: !ruby/object:Gem::Requirement
49
+ none: false
44
50
  requirements:
45
- - - "~>"
51
+ - - '='
46
52
  - !ruby/object:Gem::Version
47
- version: 0.12.0
53
+ version: 1.0.0.0.pre
48
54
  type: :runtime
49
55
  prerelease: false
50
56
  version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
51
58
  requirements:
52
- - - "~>"
59
+ - - '='
53
60
  - !ruby/object:Gem::Version
54
- version: 0.12.0
61
+ version: 1.0.0.0.pre
55
62
  - !ruby/object:Gem::Dependency
56
63
  name: bundler
57
64
  requirement: !ruby/object:Gem::Requirement
65
+ none: false
58
66
  requirements:
59
- - - "~>"
67
+ - - ~>
60
68
  - !ruby/object:Gem::Version
61
69
  version: '1.5'
62
70
  type: :development
63
71
  prerelease: false
64
72
  version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
65
74
  requirements:
66
- - - "~>"
75
+ - - ~>
67
76
  - !ruby/object:Gem::Version
68
77
  version: '1.5'
69
78
  - !ruby/object:Gem::Dependency
70
79
  name: rake
71
80
  requirement: !ruby/object:Gem::Requirement
81
+ none: false
72
82
  requirements:
73
- - - ">="
83
+ - - ! '>='
74
84
  - !ruby/object:Gem::Version
75
85
  version: '0'
76
86
  type: :development
77
87
  prerelease: false
78
88
  version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
79
90
  requirements:
80
- - - ">="
91
+ - - ! '>='
81
92
  - !ruby/object:Gem::Version
82
93
  version: '0'
83
94
  description: Build complex web UI in a modular way
@@ -87,37 +98,39 @@ executables: []
87
98
  extensions: []
88
99
  extra_rdoc_files: []
89
100
  files:
90
- - ".gitignore"
101
+ - .gitignore
91
102
  - Gemfile
92
103
  - LICENSE.txt
93
104
  - README.md
94
105
  - Rakefile
106
+ - doc/client/.keep
95
107
  - lib/netzke.rb
96
108
  - lib/netzke/version.rb
97
109
  - netzke.gemspec
110
+ - yuidoc.json
98
111
  homepage: http://netzke.org
99
- licenses:
100
- - MIT
101
- metadata: {}
112
+ licenses: []
102
113
  post_install_message:
103
114
  rdoc_options: []
104
115
  require_paths:
105
116
  - lib
106
117
  required_ruby_version: !ruby/object:Gem::Requirement
118
+ none: false
107
119
  requirements:
108
- - - ">="
120
+ - - ! '>='
109
121
  - !ruby/object:Gem::Version
110
122
  version: '0'
111
123
  required_rubygems_version: !ruby/object:Gem::Requirement
124
+ none: false
112
125
  requirements:
113
- - - ">="
126
+ - - ! '>'
114
127
  - !ruby/object:Gem::Version
115
- version: '0'
128
+ version: 1.3.1
116
129
  requirements: []
117
130
  rubyforge_project:
118
- rubygems_version: 2.4.5
131
+ rubygems_version: 1.8.23.2
119
132
  signing_key:
120
- specification_version: 4
133
+ specification_version: 3
121
134
  summary: Client-server GUI components with Sencha Ext JS and Ruby on Rails
122
135
  test_files: []
123
136
  has_rdoc:
checksums.yaml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- SHA1:
3
- metadata.gz: 88abe29aff5dd69b3b5dd4b9ed12dc578cf0b84f
4
- data.tar.gz: 5302385c591501aa28dcef9d1fda7fbd7dceda10
5
- SHA512:
6
- metadata.gz: e4079174a27ba5a5d9ce381e1ae5a85f204cb6bb5e02b074d7815f0100ac0f0c8b45898e94cb3a67807dcdb4e73b98574fa0b8a1a09708f70c8fb5c323563068
7
- data.tar.gz: d56da6c1e9d60f9a88a8f305b996c2965dfe8dc593cf3f31ffd177db11889524207bbf2cbac05b1e417750e72b99b5e8c6e25b68e043147379dbfa0d9d0e566e