plezi 0.7.0 → 0.7.1
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 +10 -0
 - data/README.md +3 -3
 - data/Rakefile +0 -1
 - data/TODO.md +0 -4
 - data/lib/plezi/handlers/magic_helpers.rb +2 -0
 - data/lib/plezi/server/helpers/http.rb +18 -3
 - data/lib/plezi/version.rb +1 -1
 - data/plezi.gemspec +3 -3
 - data/resources/environment.rb +3 -0
 - data/resources/plezi_gray.png +0 -0
 - data/resources/{anorexic_websockets.html → plezi_websockets.html} +0 -0
 - metadata +13 -10
 - data/KNOWN_ISSUES.md +0 -13
 - data/resources/anorexic_gray.png +0 -0
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA1:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 030d9117d441e83606c9ad6c5e27fbc19a6db318
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: ad87f43274ae4c0186f5357dcde773968fb17f0e
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 8267042b38ee5f2db6a21d32c2f0d533a32aae06c66627bd74b100f06850126ede7ceaf758cb79d8d963050d645cd4292730e57f1025d3fa273f2848cb8f3f2b
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: fa8952d9489c4282c517889c73f32644a3bc16247e9c31ab6aef57e9131ebc645e81387bd2fa16c12d3cbf227d2c971cd6b70fcfe2139f596a0bb663370ada0a
         
     | 
    
        data/CHANGELOG.md
    CHANGED
    
    | 
         @@ -2,6 +2,16 @@ 
     | 
|
| 
       2 
2 
     | 
    
         | 
| 
       3 
3 
     | 
    
         
             
            ***
         
     | 
| 
       4 
4 
     | 
    
         | 
| 
      
 5 
     | 
    
         
            +
            Change log v.0.7.1 - OLDER CODE MIGHT BREAK!
         
     | 
| 
      
 6 
     | 
    
         
            +
             
     | 
| 
      
 7 
     | 
    
         
            +
            **feature**: ruby objects (Integers, Floats, true & false) are now automatically converted from strings to Ruby objects (notice that 'true' and 'false' ARE case sensative, to preserve the value in case of a #to_s method call)
         
     | 
| 
      
 8 
     | 
    
         
            +
             
     | 
| 
      
 9 
     | 
    
         
            +
            **change**: Request parameter names are now converted to numbers, if they are recognized as numbers (i.e. use `params[:list][0][:name]` rather than `params[:list]['0'.to_sym][:name]`)
         
     | 
| 
      
 10 
     | 
    
         
            +
             
     | 
| 
      
 11 
     | 
    
         
            +
            **Logo**: we're still working on a nice logo... but we have a lot on our todo list. so we put a temporary one in.
         
     | 
| 
      
 12 
     | 
    
         
            +
             
     | 
| 
      
 13 
     | 
    
         
            +
            ***
         
     | 
| 
      
 14 
     | 
    
         
            +
             
     | 
| 
       5 
15 
     | 
    
         
             
            Change log v.0.7.0
         
     | 
| 
       6 
16 
     | 
    
         | 
| 
       7 
17 
     | 
    
         
             
            Welcome our new name, Plezi.
         
     | 
    
        data/README.md
    CHANGED
    
    | 
         @@ -1,4 +1,4 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            # Plezi, The  
     | 
| 
      
 1 
     | 
    
         
            +
            # Plezi, The Rack Free Ruby HTTP & Websocket Framework
         
     | 
| 
       2 
2 
     | 
    
         
             
            [](http://badge.fury.io/rb/plezi)
         
     | 
| 
       3 
3 
     | 
    
         
             
            [](http://inch-ci.org/github/boazsegev/plezi)
         
     | 
| 
       4 
4 
     | 
    
         | 
| 
         @@ -27,7 +27,7 @@ Or install it yourself as: 
     | 
|
| 
       27 
27 
     | 
    
         | 
| 
       28 
28 
     | 
    
         
             
                $ gem install plezi
         
     | 
| 
       29 
29 
     | 
    
         | 
| 
       30 
     | 
    
         
            -
            ## Creating  
     | 
| 
      
 30 
     | 
    
         
            +
            ## Creating a Plezi Application
         
     | 
| 
       31 
31 
     | 
    
         | 
| 
       32 
32 
     | 
    
         
             
            to create a new barebones app using the Plezi framework, run from terminal:
         
     | 
| 
       33 
33 
     | 
    
         | 
| 
         @@ -79,7 +79,7 @@ Controllers can even be nested (order matters) or have advanced uses that are de 
     | 
|
| 
       79 
79 
     | 
    
         | 
| 
       80 
80 
     | 
    
         
             
            **please read the demo code for Plezi::StubRESTCtrl and Plezi::StubWSCtrl to learn more.**
         
     | 
| 
       81 
81 
     | 
    
         | 
| 
       82 
     | 
    
         
            -
            ## Native Websocket and  
     | 
| 
      
 82 
     | 
    
         
            +
            ## Native Websocket and Redis support
         
     | 
| 
       83 
83 
     | 
    
         | 
| 
       84 
84 
     | 
    
         
             
            Plezi Controllers have access to native websocket support through the `pre_connect`, `on_connect`, `on_message(data)`, `on_disconnect`, `broadcast` and `collect` methods.
         
     | 
| 
       85 
85 
     | 
    
         | 
    
        data/Rakefile
    CHANGED
    
    
    
        data/TODO.md
    CHANGED
    
    
| 
         @@ -75,12 +75,12 @@ module Plezi 
     | 
|
| 
       75 
75 
     | 
    
         
             
            			begin
         
     | 
| 
       76 
76 
     | 
    
         
             
            				a = target_hash
         
     | 
| 
       77 
77 
     | 
    
         
             
            				p = param_name.gsub(']',' ').split(/\[/)
         
     | 
| 
       78 
     | 
    
         
            -
            				 
     | 
| 
       79 
     | 
    
         
            -
            				a <<  
     | 
| 
      
 78 
     | 
    
         
            +
            				val = rubyfy! param_value
         
     | 
| 
      
 79 
     | 
    
         
            +
            				p.each_index { |i| p[i].strip! ; n = p[i].match(/^[0-9]+$/) ? p[i].to_i : p[i].to_sym ; p[i+1] ? [ ( a[n] ||= ( p[i+1] == ' ' ? [] : {} ) ), ( a = a[n]) ] : ( a.is_a?(Hash) ? (a[n] ? (a[n].is_a?(Array) ? (a << val) : a[n] = [a[n], val] ) : (a[n] = val) ) : (a << val) ) }
         
     | 
| 
       80 
80 
     | 
    
         
             
            			rescue Exception => e
         
     | 
| 
       81 
81 
     | 
    
         
             
            				Plezi.error e
         
     | 
| 
       82 
82 
     | 
    
         
             
            				Plezi.error "(Silent): paramaters parse error for #{param_name} ... maybe conflicts with a different set?"
         
     | 
| 
       83 
     | 
    
         
            -
            				target_hash[param_name] =  
     | 
| 
      
 83 
     | 
    
         
            +
            				target_hash[param_name] = rubyfy! param_value
         
     | 
| 
       84 
84 
     | 
    
         
             
            			end
         
     | 
| 
       85 
85 
     | 
    
         
             
            		end
         
     | 
| 
       86 
86 
     | 
    
         | 
| 
         @@ -164,6 +164,21 @@ module Plezi 
     | 
|
| 
       164 
164 
     | 
    
         
             
            			string
         
     | 
| 
       165 
165 
     | 
    
         
             
            		end
         
     | 
| 
       166 
166 
     | 
    
         | 
| 
      
 167 
     | 
    
         
            +
            		# Changes String to a Ruby Object, if it's a special string
         
     | 
| 
      
 168 
     | 
    
         
            +
            		def rubyfy!(string)
         
     | 
| 
      
 169 
     | 
    
         
            +
            			return false unless string
         
     | 
| 
      
 170 
     | 
    
         
            +
            			make_utf8! string
         
     | 
| 
      
 171 
     | 
    
         
            +
            			if string == 'true'
         
     | 
| 
      
 172 
     | 
    
         
            +
            				string = true
         
     | 
| 
      
 173 
     | 
    
         
            +
            			elsif string == 'false'
         
     | 
| 
      
 174 
     | 
    
         
            +
            				string = false
         
     | 
| 
      
 175 
     | 
    
         
            +
            			elsif string.match(/[0-9]/) && !string.match(/[^0-9]/)
         
     | 
| 
      
 176 
     | 
    
         
            +
            				string = string.to_i
         
     | 
| 
      
 177 
     | 
    
         
            +
            			elsif string.match(/[0-9]/) && !string.match(/[^0-9\.]/)
         
     | 
| 
      
 178 
     | 
    
         
            +
            				string = string.to_f
         
     | 
| 
      
 179 
     | 
    
         
            +
            			end
         
     | 
| 
      
 180 
     | 
    
         
            +
            			string
         
     | 
| 
      
 181 
     | 
    
         
            +
            		end
         
     | 
| 
       167 
182 
     | 
    
         | 
| 
       168 
183 
     | 
    
         
             
            	end
         
     | 
| 
       169 
184 
     | 
    
         
             
            end
         
     | 
    
        data/lib/plezi/version.rb
    CHANGED
    
    
    
        data/plezi.gemspec
    CHANGED
    
    | 
         @@ -8,8 +8,8 @@ Gem::Specification.new do |spec| 
     | 
|
| 
       8 
8 
     | 
    
         
             
              spec.version       = Plezi::VERSION
         
     | 
| 
       9 
9 
     | 
    
         
             
              spec.authors       = ["Boaz Segev"]
         
     | 
| 
       10 
10 
     | 
    
         
             
              spec.email         = ['boaz@2be.co.il']
         
     | 
| 
       11 
     | 
    
         
            -
              spec.summary       = %q{The Ruby  
     | 
| 
       12 
     | 
    
         
            -
              spec.description   = %q{Plezi is  
     | 
| 
      
 11 
     | 
    
         
            +
              spec.summary       = %q{The Ruby Web-App Framework with Websockets, REST and HTTP streaming support.}
         
     | 
| 
      
 12 
     | 
    
         
            +
              spec.description   = %q{Plezi is a Rack free Ruby Web-App Framework with native Websocket, HTTP streaming, and REST routing support. Advance to next step in Ruby evolution - a framework with an integrated server, ready for seamless WebSockets and RESTful applications.}
         
     | 
| 
       13 
13 
     | 
    
         
             
              spec.homepage      = "http://boazsegev.github.io/plezi/"
         
     | 
| 
       14 
14 
     | 
    
         
             
              spec.license       = "MIT"
         
     | 
| 
       15 
15 
     | 
    
         | 
| 
         @@ -21,6 +21,6 @@ Gem::Specification.new do |spec| 
     | 
|
| 
       21 
21 
     | 
    
         
             
              spec.add_development_dependency "bundler", "~> 1.7"
         
     | 
| 
       22 
22 
     | 
    
         
             
              spec.add_development_dependency "rake", "~> 10.0"
         
     | 
| 
       23 
23 
     | 
    
         | 
| 
       24 
     | 
    
         
            -
              spec.post_install_message = " 
     | 
| 
      
 24 
     | 
    
         
            +
              spec.post_install_message = "This update might break existing code - please review ChangeLog.md before upgrading any apps.\n\r\n\rFor example\n\r-Please make sure to change any `params[:list]['0'.to_sym][:key]` to `params[:list][0][:key]` (Fixnum rather then String).\n\r- Pleasemake sure to update `params[:check] == 'true'` to `params[:check] == true` (not aString)."
         
     | 
| 
       25 
25 
     | 
    
         | 
| 
       26 
26 
     | 
    
         
             
            end
         
     | 
    
        data/resources/environment.rb
    CHANGED
    
    | 
         @@ -20,6 +20,9 @@ ENV["RACK_ENV"] ||= "development" 
     | 
|
| 
       20 
20 
     | 
    
         
             
            require 'bundler'
         
     | 
| 
       21 
21 
     | 
    
         
             
            Bundler.require
         
     | 
| 
       22 
22 
     | 
    
         | 
| 
      
 23 
     | 
    
         
            +
            # require tilt/sass in a thread safe way (before multi-threading cycle begins)
         
     | 
| 
      
 24 
     | 
    
         
            +
            require 'tilt/sass' if defined?(::Slim) && defined?(::Sass)
         
     | 
| 
      
 25 
     | 
    
         
            +
             
     | 
| 
       23 
26 
     | 
    
         
             
            # set up Plezi logs - Heroku logs to STDOUT, this machine logs to log file
         
     | 
| 
       24 
27 
     | 
    
         
             
            Plezi.create_logger File.expand_path(File.join 'logs','server.log'), ENV["RACK_ENV"]=="development" unless ENV['DYNO']
         
     | 
| 
       25 
28 
     | 
    
         | 
| 
         Binary file 
     | 
| 
         
            File without changes
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: plezi
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0.7. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.7.1
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Boaz Segev
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2015- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2015-03-07 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: bundler
         
     | 
| 
         @@ -38,9 +38,9 @@ dependencies: 
     | 
|
| 
       38 
38 
     | 
    
         
             
                - - "~>"
         
     | 
| 
       39 
39 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       40 
40 
     | 
    
         
             
                    version: '10.0'
         
     | 
| 
       41 
     | 
    
         
            -
            description: Plezi is  
     | 
| 
       42 
     | 
    
         
            -
              next step in Ruby evolution - a 
     | 
| 
       43 
     | 
    
         
            -
              WebSockets and RESTful applications.
         
     | 
| 
      
 41 
     | 
    
         
            +
            description: Plezi is a Rack free Ruby Web-App Framework with native Websocket, HTTP
         
     | 
| 
      
 42 
     | 
    
         
            +
              streaming, and REST routing support. Advance to next step in Ruby evolution - a
         
     | 
| 
      
 43 
     | 
    
         
            +
              framework with an integrated server, ready for seamless WebSockets and RESTful applications.
         
     | 
| 
       44 
44 
     | 
    
         
             
            email:
         
     | 
| 
       45 
45 
     | 
    
         
             
            - boaz@2be.co.il
         
     | 
| 
       46 
46 
     | 
    
         
             
            executables:
         
     | 
| 
         @@ -51,7 +51,6 @@ files: 
     | 
|
| 
       51 
51 
     | 
    
         
             
            - ".gitignore"
         
     | 
| 
       52 
52 
     | 
    
         
             
            - CHANGELOG.md
         
     | 
| 
       53 
53 
     | 
    
         
             
            - Gemfile
         
     | 
| 
       54 
     | 
    
         
            -
            - KNOWN_ISSUES.md
         
     | 
| 
       55 
54 
     | 
    
         
             
            - LICENSE.txt
         
     | 
| 
       56 
55 
     | 
    
         
             
            - README.md
         
     | 
| 
       57 
56 
     | 
    
         
             
            - Rakefile
         
     | 
| 
         @@ -97,8 +96,6 @@ files: 
     | 
|
| 
       97 
96 
     | 
    
         
             
            - resources/500.html
         
     | 
| 
       98 
97 
     | 
    
         
             
            - resources/500.slim
         
     | 
| 
       99 
98 
     | 
    
         
             
            - resources/Gemfile
         
     | 
| 
       100 
     | 
    
         
            -
            - resources/anorexic_gray.png
         
     | 
| 
       101 
     | 
    
         
            -
            - resources/anorexic_websockets.html
         
     | 
| 
       102 
99 
     | 
    
         
             
            - resources/code.rb
         
     | 
| 
       103 
100 
     | 
    
         
             
            - resources/config.ru
         
     | 
| 
       104 
101 
     | 
    
         
             
            - resources/controller.rb
         
     | 
| 
         @@ -109,6 +106,8 @@ files: 
     | 
|
| 
       109 
106 
     | 
    
         
             
            - resources/environment.rb
         
     | 
| 
       110 
107 
     | 
    
         
             
            - resources/haml_config.rb
         
     | 
| 
       111 
108 
     | 
    
         
             
            - resources/i18n_config.rb
         
     | 
| 
      
 109 
     | 
    
         
            +
            - resources/plezi_gray.png
         
     | 
| 
      
 110 
     | 
    
         
            +
            - resources/plezi_websockets.html
         
     | 
| 
       112 
111 
     | 
    
         
             
            - resources/rakefile.rb
         
     | 
| 
       113 
112 
     | 
    
         
             
            - resources/redis_config.rb
         
     | 
| 
       114 
113 
     | 
    
         
             
            - resources/routes.rb
         
     | 
| 
         @@ -118,7 +117,11 @@ homepage: http://boazsegev.github.io/plezi/ 
     | 
|
| 
       118 
117 
     | 
    
         
             
            licenses:
         
     | 
| 
       119 
118 
     | 
    
         
             
            - MIT
         
     | 
| 
       120 
119 
     | 
    
         
             
            metadata: {}
         
     | 
| 
       121 
     | 
    
         
            -
            post_install_message:  
     | 
| 
      
 120 
     | 
    
         
            +
            post_install_message: "This update might break existing code - please review ChangeLog.md
         
     | 
| 
      
 121 
     | 
    
         
            +
              before upgrading any apps.\n\r\n\rFor example\n\r-Please make sure to change any
         
     | 
| 
      
 122 
     | 
    
         
            +
              `params[:list]['0'.to_sym][:key]` to `params[:list][0][:key]` (Fixnum rather then
         
     | 
| 
      
 123 
     | 
    
         
            +
              String).\n\r- Pleasemake sure to update `params[:check] == 'true'` to `params[:check]
         
     | 
| 
      
 124 
     | 
    
         
            +
              == true` (not aString)."
         
     | 
| 
       122 
125 
     | 
    
         
             
            rdoc_options: []
         
     | 
| 
       123 
126 
     | 
    
         
             
            require_paths:
         
     | 
| 
       124 
127 
     | 
    
         
             
            - lib
         
     | 
| 
         @@ -137,5 +140,5 @@ rubyforge_project: 
     | 
|
| 
       137 
140 
     | 
    
         
             
            rubygems_version: 2.4.5
         
     | 
| 
       138 
141 
     | 
    
         
             
            signing_key: 
         
     | 
| 
       139 
142 
     | 
    
         
             
            specification_version: 4
         
     | 
| 
       140 
     | 
    
         
            -
            summary: The Ruby  
     | 
| 
      
 143 
     | 
    
         
            +
            summary: The Ruby Web-App Framework with Websockets, REST and HTTP streaming support.
         
     | 
| 
       141 
144 
     | 
    
         
             
            test_files: []
         
     | 
    
        data/KNOWN_ISSUES.md
    DELETED
    
    | 
         @@ -1,13 +0,0 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            # Known Issues
         
     | 
| 
       2 
     | 
    
         
            -
             
     | 
| 
       3 
     | 
    
         
            -
            Here we will list known issues and weather or not a solution is being persued.
         
     | 
| 
       4 
     | 
    
         
            -
             
     | 
| 
       5 
     | 
    
         
            -
            ## Caching?
         
     | 
| 
       6 
     | 
    
         
            -
             
     | 
| 
       7 
     | 
    
         
            -
            seems caching sometimes fails ( data isn't cached / cache keeps reloading)...?
         
     | 
| 
       8 
     | 
    
         
            -
             
     | 
| 
       9 
     | 
    
         
            -
            ## Chuncked data issues? or Apache benchmarks bug?
         
     | 
| 
       10 
     | 
    
         
            -
             
     | 
| 
       11 
     | 
    
         
            -
            the Apache benchmark hangs some requests, when chuncked data and missing mimetypes are introduced...
         
     | 
| 
       12 
     | 
    
         
            -
             
     | 
| 
       13 
     | 
    
         
            -
            is this a server or benchmark error?
         
     | 
    
        data/resources/anorexic_gray.png
    DELETED
    
    | 
         Binary file 
     |