padrino-support 0.13.1 → 0.13.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: 1d453e0892637ad5ecd1ecd5f19beffae03301cc
4
- data.tar.gz: c06c6d676c253f88efc4d52ba340c02f44a204a9
3
+ metadata.gz: 98254f4842554e96dd0accf958ab629966ae8484
4
+ data.tar.gz: 508e6954fe00f2856c9ff99a45cc3ae06d1a67d4
5
5
  SHA512:
6
- metadata.gz: 21570003ba947f1294aa54274015119bf7027e8b31d9c74274e69ef0dca40654b3061bbc745a973e4c79eb778eb60de51d0730e8ffc992269bf9af5bcc815390
7
- data.tar.gz: 9bb250daa864f0e41c202cf19c7329b9e9d855d27fe6182f3ac293058c748341b1bff49befbd57bca968965dbea1e9aeb5a61b1e9e09fdacfe7a7bfbb16e37fe
6
+ metadata.gz: b35602c73202904b25577d8944e960a2f0835802c8499488cfb42f7853009abae55131750734eed24e318b2401b910411f6f6f23b0bd3f8c1c81923827286758
7
+ data.tar.gz: e1d56e38387badce7ba88c35f3dcbf2fa28a0641294844fa5fc7c5b76278ea8c274efa55cb13622fca561adbc8f5dc0e641f405d77b5696fe0eed005366e8a42
@@ -1,8 +1,6 @@
1
1
  ##
2
2
  # This file loads certain extensions required by Padrino from ActiveSupport.
3
3
  #
4
- require 'active_support/core_ext/module/aliasing' # alias_method_chain
5
- require 'active_support/core_ext/hash/reverse_merge' # reverse_merge
6
4
  require 'active_support/core_ext/hash/keys' # symbolize_keys
7
5
  require 'active_support/core_ext/hash/indifferent_access' # params[:foo]
8
6
  require 'active_support/core_ext/hash/slice' # slice
@@ -10,6 +8,10 @@ require 'active_support/core_ext/array/extract_options' # Array#extract_opti
10
8
  require 'active_support/core_ext/object/blank' # present?
11
9
  require 'active_support/core_ext/string/output_safety' # SafeBuffer and html_safe
12
10
 
11
+ # Remove these on 0.14:
12
+ require 'active_support/core_ext/hash/reverse_merge' # reverse_merge
13
+ require 'active_support/core_ext/module/aliasing' # alias_method_chain
14
+
13
15
  require 'padrino-support/core_ext/string/inflections'
14
16
  require 'padrino-support/core_ext/string/colorize'
15
17
  require 'padrino-support/core_ext/object_space'
@@ -30,5 +32,5 @@ end
30
32
  # In reloader for accessing class_name Foo._orig_klass_name
31
33
  #
32
34
  class Module
33
- alias :_orig_klass_name :to_s
35
+ alias :_orig_klass_name :name
34
36
  end
@@ -11,21 +11,10 @@ module ObjectSpace
11
11
  # end
12
12
  # end
13
13
  #
14
- def classes
15
- rs = Set.new
16
-
17
- ObjectSpace.each_object(Class).each do |klass|
18
- if block_given?
19
- if r = yield(klass)
20
- # add the returned value if the block returns something
21
- rs << r
22
- end
23
- else
24
- rs << klass
25
- end
26
- end
27
-
28
- rs
14
+ def classes(&block)
15
+ warn 'Warning! ObjectSpace.classes will be removed in Padrino 0.14'
16
+ require 'padrino-core/reloader'
17
+ Padrino::Reloader::Storage.send(:object_classes, &block)
29
18
  end
30
19
 
31
20
  ##
@@ -39,11 +28,9 @@ module ObjectSpace
39
28
  # ObjectSpace.new_classes(snapshot)
40
29
  #
41
30
  def new_classes(snapshot)
42
- self.classes do |klass|
43
- if !snapshot.include?(klass)
44
- klass
45
- end
46
- end
31
+ warn 'Warning! ObjectSpace.new_classes will be removed in Padrino 0.14'
32
+ require 'padrino-core/reloader'
33
+ Padrino::Reloader::Storage.send(:new_classes, snapshot)
47
34
  end
48
35
  end
49
36
  end
@@ -95,4 +95,18 @@ class String
95
95
  def classify
96
96
  ActiveSupport::Inflector.classify(self)
97
97
  end
98
+
99
+ ##
100
+ # Capitalizes the first word, turns underscores into spaces, and strips a trailing '_id' if present.
101
+ #
102
+ def humanize(options = {})
103
+ ActiveSupport::Inflector.humanize(self, options)
104
+ end
105
+
106
+ ##
107
+ # Replaces underscores with dashes in the string.
108
+ #
109
+ def dasherize
110
+ ActiveSupport::Inflector.dasherize(self)
111
+ end
98
112
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: padrino-support
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.1
4
+ version: 0.13.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Padrino Team
@@ -12,20 +12,20 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2016-01-17 00:00:00.000000000 Z
15
+ date: 2016-05-09 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: activesupport
19
19
  requirement: !ruby/object:Gem::Requirement
20
20
  requirements:
21
- - - '>='
21
+ - - ">="
22
22
  - !ruby/object:Gem::Version
23
23
  version: '3.1'
24
24
  type: :runtime
25
25
  prerelease: false
26
26
  version_requirements: !ruby/object:Gem::Requirement
27
27
  requirements:
28
- - - '>='
28
+ - - ">="
29
29
  - !ruby/object:Gem::Version
30
30
  version: '3.1'
31
31
  description: A number of support methods and extensions for Padrino framework
@@ -34,9 +34,9 @@ executables: []
34
34
  extensions: []
35
35
  extra_rdoc_files: []
36
36
  files:
37
- - .document
38
- - .gitignore
39
- - .yardopts
37
+ - ".document"
38
+ - ".gitignore"
39
+ - ".yardopts"
40
40
  - LICENSE.txt
41
41
  - Rakefile
42
42
  - lib/padrino-support.rb
@@ -77,17 +77,17 @@ licenses:
77
77
  metadata: {}
78
78
  post_install_message:
79
79
  rdoc_options:
80
- - --charset=UTF-8
80
+ - "--charset=UTF-8"
81
81
  require_paths:
82
82
  - lib
83
83
  required_ruby_version: !ruby/object:Gem::Requirement
84
84
  requirements:
85
- - - '>='
85
+ - - ">="
86
86
  - !ruby/object:Gem::Version
87
87
  version: '0'
88
88
  required_rubygems_version: !ruby/object:Gem::Requirement
89
89
  requirements:
90
- - - '>='
90
+ - - ">="
91
91
  - !ruby/object:Gem::Version
92
92
  version: 1.3.6
93
93
  requirements: []