rails-dsl 0.5.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -12
- data/VERSION +1 -1
- data/lib/rails-dsl.rb +3 -2
- data/lib/rails-dsl/kill_server.rb +1 -4
- data/lib/rails-dsl/lib_mounter.rb +11 -0
- data/rails-dsl.gemspec +3 -1
- metadata +17 -4
- data/lib/rails-dsl/duck_params.rb +0 -44
- data/lib/rails-dsl/lib_boot.rb +0 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 98e3c0e380e01110c13f244d3c305baf997ea051
|
4
|
+
data.tar.gz: a144f783e3fe53a04f41a6f2e692681541c0d165
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8a1920286ea77abfb2e3dfe19b0b9db3f6448067cf37312e0f06f9f409c212890343d6c84b7ebe87cbe82f23c2d7964e24f2a3dfdd4170b585aa7657e1bfb901
|
7
|
+
data.tar.gz: 4d548d8d1f6768bd4249274befaf4e040625694e666d9b13bb7dcce18daeba97ea31755b4dec2eb6634b749709128d45592cec1130e457619c6e24f4844dbc9e
|
data/README.md
CHANGED
@@ -3,18 +3,6 @@ rails-dsl
|
|
3
3
|
|
4
4
|
Provide Rails with some extra helpers,
|
5
5
|
|
6
|
-
### Controller
|
7
|
-
|
8
|
-
For example for to ActionController::Base a 'duck_params' that parse string values into the right obj,
|
9
|
-
like:
|
10
|
-
|
11
|
-
* "123" to Fixnum
|
12
|
-
* {"hello":"world"} json into Hash
|
13
|
-
* "Fri, 25 Jan 2013 20:02:15 +0100" to DateTime obj
|
14
|
-
* "123.123" to Float obj
|
15
|
-
* "2011-03-12" to Date obj
|
16
|
-
* etc etc etc
|
17
|
-
|
18
6
|
### Terminal
|
19
7
|
|
20
8
|
if you call rails with 'kill' / 'k' command from now on, it will kill the application by it's pid file
|
@@ -126,3 +114,7 @@ in this mount options
|
|
126
114
|
|
127
115
|
```
|
128
116
|
|
117
|
+
### Rails console Bug Fix
|
118
|
+
|
119
|
+
for fixing the annoying error with the rails console,
|
120
|
+
i added deppendency for the rb-readline gem, witch implement the missing error
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.6.0
|
data/lib/rails-dsl.rb
CHANGED
@@ -31,7 +31,6 @@ module Rails
|
|
31
31
|
end
|
32
32
|
|
33
33
|
module EXT
|
34
|
-
|
35
34
|
def kill?
|
36
35
|
|
37
36
|
unless %W[ --kill kill k ].select{|sym| ARGV.include?(sym) }.empty?
|
@@ -62,7 +61,6 @@ module Rails
|
|
62
61
|
end
|
63
62
|
|
64
63
|
end
|
65
|
-
|
66
64
|
end
|
67
65
|
end
|
68
66
|
|
@@ -70,5 +68,4 @@ module Rails
|
|
70
68
|
|
71
69
|
end
|
72
70
|
end
|
73
|
-
|
74
|
-
Rails::DSL.kill?
|
71
|
+
Rails::DSL.kill? #> will kill if rails was started with kill command
|
@@ -0,0 +1,11 @@
|
|
1
|
+
# in most of my project i use a boot.rb file in the libs folder for 3. party libs
|
2
|
+
Thread.new do
|
3
|
+
|
4
|
+
sleep(0.5) while Rails.root.nil?
|
5
|
+
if File.exist?(Rails.root.join('lib','boot.rb'))
|
6
|
+
require Rails.root.join('lib','boot.rb')
|
7
|
+
else
|
8
|
+
Dir.glob( Rails.root.join('lib','*.{ru,rb}') ).each { |p| require(p) }
|
9
|
+
end
|
10
|
+
|
11
|
+
end
|
data/rails-dsl.gemspec
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
# coding: utf-8
|
2
|
-
|
3
2
|
Gem::Specification.new do |spec|
|
4
3
|
|
5
4
|
spec.name = "rails-dsl"
|
@@ -22,4 +21,7 @@ Gem::Specification.new do |spec|
|
|
22
21
|
spec.add_dependency "str2duck", ">= 1.6.0"
|
23
22
|
spec.add_dependency "rails", ">= 3.0.0"
|
24
23
|
|
24
|
+
#> fix the annoying readline bug with rails console
|
25
|
+
spec.add_dependency "rb-readline", '~> 0.4.2'
|
26
|
+
|
25
27
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails-dsl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Luzsi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-07-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -66,6 +66,20 @@ dependencies:
|
|
66
66
|
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: 3.0.0
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rb-readline
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 0.4.2
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 0.4.2
|
69
83
|
description: " Provide Rails with some extra tools, please read README.md on git "
|
70
84
|
email:
|
71
85
|
- adamluzsi@gmail.com
|
@@ -79,9 +93,8 @@ files:
|
|
79
93
|
- Rakefile
|
80
94
|
- VERSION
|
81
95
|
- lib/rails-dsl.rb
|
82
|
-
- lib/rails-dsl/duck_params.rb
|
83
96
|
- lib/rails-dsl/kill_server.rb
|
84
|
-
- lib/rails-dsl/
|
97
|
+
- lib/rails-dsl/lib_mounter.rb
|
85
98
|
- lib/rails-dsl/routes_ext.rb
|
86
99
|
- rails-dsl.gemspec
|
87
100
|
homepage: https://github.com/adamluzsi/rails-dsl
|
@@ -1,44 +0,0 @@
|
|
1
|
-
begin
|
2
|
-
|
3
|
-
require 'str2duck'
|
4
|
-
require 'action_controller'
|
5
|
-
|
6
|
-
module Rails
|
7
|
-
module DSL
|
8
|
-
|
9
|
-
module ActionControllerEXT
|
10
|
-
|
11
|
-
def params_duck
|
12
|
-
|
13
|
-
@duck_params_origin ||= params.dup
|
14
|
-
@duck_params_cache ||= nil
|
15
|
-
|
16
|
-
if params == @duck_params_origin && !@duck_params_cache.nil?
|
17
|
-
|
18
|
-
return @duck_params_cache
|
19
|
-
|
20
|
-
else
|
21
|
-
|
22
|
-
@duck_params_cache= params.dup
|
23
|
-
@duck_params_origin= params.dup
|
24
|
-
|
25
|
-
params.each do |k,v|
|
26
|
-
@duck_params_cache[k]=( ::Str2Duck.parse(v) ) if v.class <= String
|
27
|
-
end
|
28
|
-
|
29
|
-
return @duck_params_cache
|
30
|
-
|
31
|
-
end
|
32
|
-
|
33
|
-
end
|
34
|
-
alias duck_params params_duck
|
35
|
-
|
36
|
-
end
|
37
|
-
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
ActionController::Base.__send__ :include, Rails::DSL::ActionControllerEXT
|
42
|
-
|
43
|
-
rescue LoadError
|
44
|
-
end
|