padrino 0.12.9 → 0.13.0.beta1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- OTNiZTA1OGM0ODRiNDNmZWY0ZDFlNmMzODZiZTc0Y2Q0YTU4YWZkNw==
5
- data.tar.gz: !binary |-
6
- OWI1NmY2ZTQ0NzE3ZDA5Yjk4ODI2YTM2OGI3MTZmZjMxOWYzYjhhMA==
2
+ SHA1:
3
+ metadata.gz: b35efe23c1d9dbda4464f8ba7ee91ce6af30dcc2
4
+ data.tar.gz: ab84b92cee7c96422e68fd076ffe285ef299de8f
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- ZTU1MTc0YmRiM2RhYmZkOWY1ZTg5MjhkYzhhOTQ5MDdjZmY5YTA4OTg4ZWNm
10
- MTE1ZDk1ZWJhYWY3NjJhOWM0ODY4NGEzMWI5MzQ0NDUwMGU0NTVhZTFmYzAz
11
- YjQwMWUzMDU5MjViOGQ3OTgxZmEwNzY0Yjg0YWE2OTkyYmIyZWE=
12
- data.tar.gz: !binary |-
13
- ZDM5MzI0YmVlZTVkOWM2MjI2N2Q5NGE5NjFkMDBjYzk4ZWNhMDRlYjNiYzMw
14
- ODFkYmE1MmE5ZmYyM2E3ZDU3NGM1NzY4ZTU5OTlmODMzMGY2OGM2ZDhhMTNm
15
- NmZlMzUyZDExODgwNjU3ODFhODc1Mzc2OTg4NTFhNDcyMmEzZWI=
6
+ metadata.gz: d2c4bbede9e7e03c57893a09b78dd2c03a3ab79a438694178b215f4f9b304ad89e0f2404010bc9c46cab30137fad2ffa9bbe49a02f7c50ce9d0777bd460f7d35
7
+ data.tar.gz: 9dbb378a3de840a39d4ad2ae44f5c67610f2077580e0be6deeacecd48b0ae15056b86bedeb82d98b02c39f1af67ed196a229f316bdcb5fdfc821c4ab0b374502
data/subgems.rb CHANGED
@@ -4,6 +4,6 @@ performance_gemspec = ::Gem::Specification.load(File.expand_path(File.dirname(__
4
4
  PADRINO_SUBGEMS ||= Hash[padrino_gemspec.dependencies.map{ |gem| [gem.name, gem.requirement.to_s] }]
5
5
 
6
6
  PADRINO_GEMS ||= PADRINO_SUBGEMS.merge(
7
- 'padrino' => padrino_gemspec.version.to_s,
8
7
  'padrino-performance' => performance_gemspec.version.to_s,
8
+ 'padrino' => padrino_gemspec.version.to_s,
9
9
  )
@@ -1,4 +1,20 @@
1
1
  class MiniTest::Spec
2
+ # assert_has_tag(:h1, :content => "yellow") { "<h1>yellow</h1>" }
3
+ # In this case, block is the html to evaluate
4
+ def assert_has_tag(name, attributes = {})
5
+ html = yield if block_given?
6
+ fail "Please specify a block" if html.blank?
7
+ assert html.html_safe?, 'output in not #html_safe?'
8
+ matcher = HaveSelector.new(name, attributes)
9
+ assert matcher.matches?(html), matcher.failure_message
10
+ end
11
+
12
+ # assert_has_no_tag(:h1, :content => "yellow") { "<h1>green</h1>" }
13
+ # In this case, block is the html to evaluate
14
+ def assert_has_no_tag(name, attributes = {}, &block)
15
+ assert_has_tag(name, attributes.merge(:count => 0), &block)
16
+ end
17
+
2
18
  # Assert_file_exists('/tmp/app')
3
19
  def assert_file_exists(file_path)
4
20
  assert File.file?(file_path), "File at path '#{file_path}' does not exist!"
@@ -0,0 +1,28 @@
1
+ # This monkey patch is because rack-test gem looks abandoned
2
+ module Rack
3
+ module Test
4
+ module Utils # :nodoc:
5
+ def build_nested_query(value, prefix = nil)
6
+ case value
7
+ when Array
8
+ value.map do |v|
9
+ unless unescape(prefix) =~ /\[\]$/
10
+ prefix = "#{prefix}[]"
11
+ end
12
+ build_nested_query(v, "#{prefix}")
13
+ end.join("&")
14
+ when Hash
15
+ value.map do |k, v|
16
+ build_nested_query(v, prefix ? "#{prefix}[#{escape(k)}]" : escape(k))
17
+ end.join("&")
18
+ when NilClass
19
+ prefix.to_s
20
+ else
21
+ # prefix should be escaped to conform rfc3986
22
+ # was: "#{prefix}=#{escape(value)}"
23
+ "#{escape(prefix)}=#{escape(value)}"
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: padrino
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.9
4
+ version: 0.13.0.beta1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Padrino Team
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2018-02-23 00:00:00.000000000 Z
14
+ date: 2015-02-22 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: padrino-support
@@ -19,98 +19,98 @@ dependencies:
19
19
  requirements:
20
20
  - - '='
21
21
  - !ruby/object:Gem::Version
22
- version: 0.12.9
22
+ version: 0.13.0.beta1
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
27
  - - '='
28
28
  - !ruby/object:Gem::Version
29
- version: 0.12.9
29
+ version: 0.13.0.beta1
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: padrino-core
32
32
  requirement: !ruby/object:Gem::Requirement
33
33
  requirements:
34
34
  - - '='
35
35
  - !ruby/object:Gem::Version
36
- version: 0.12.9
36
+ version: 0.13.0.beta1
37
37
  type: :runtime
38
38
  prerelease: false
39
39
  version_requirements: !ruby/object:Gem::Requirement
40
40
  requirements:
41
41
  - - '='
42
42
  - !ruby/object:Gem::Version
43
- version: 0.12.9
43
+ version: 0.13.0.beta1
44
44
  - !ruby/object:Gem::Dependency
45
45
  name: padrino-helpers
46
46
  requirement: !ruby/object:Gem::Requirement
47
47
  requirements:
48
48
  - - '='
49
49
  - !ruby/object:Gem::Version
50
- version: 0.12.9
50
+ version: 0.13.0.beta1
51
51
  type: :runtime
52
52
  prerelease: false
53
53
  version_requirements: !ruby/object:Gem::Requirement
54
54
  requirements:
55
55
  - - '='
56
56
  - !ruby/object:Gem::Version
57
- version: 0.12.9
57
+ version: 0.13.0.beta1
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: padrino-cache
60
60
  requirement: !ruby/object:Gem::Requirement
61
61
  requirements:
62
62
  - - '='
63
63
  - !ruby/object:Gem::Version
64
- version: 0.12.9
64
+ version: 0.13.0.beta1
65
65
  type: :runtime
66
66
  prerelease: false
67
67
  version_requirements: !ruby/object:Gem::Requirement
68
68
  requirements:
69
69
  - - '='
70
70
  - !ruby/object:Gem::Version
71
- version: 0.12.9
71
+ version: 0.13.0.beta1
72
72
  - !ruby/object:Gem::Dependency
73
73
  name: padrino-mailer
74
74
  requirement: !ruby/object:Gem::Requirement
75
75
  requirements:
76
76
  - - '='
77
77
  - !ruby/object:Gem::Version
78
- version: 0.12.9
78
+ version: 0.13.0.beta1
79
79
  type: :runtime
80
80
  prerelease: false
81
81
  version_requirements: !ruby/object:Gem::Requirement
82
82
  requirements:
83
83
  - - '='
84
84
  - !ruby/object:Gem::Version
85
- version: 0.12.9
85
+ version: 0.13.0.beta1
86
86
  - !ruby/object:Gem::Dependency
87
87
  name: padrino-gen
88
88
  requirement: !ruby/object:Gem::Requirement
89
89
  requirements:
90
90
  - - '='
91
91
  - !ruby/object:Gem::Version
92
- version: 0.12.9
92
+ version: 0.13.0.beta1
93
93
  type: :runtime
94
94
  prerelease: false
95
95
  version_requirements: !ruby/object:Gem::Requirement
96
96
  requirements:
97
97
  - - '='
98
98
  - !ruby/object:Gem::Version
99
- version: 0.12.9
99
+ version: 0.13.0.beta1
100
100
  - !ruby/object:Gem::Dependency
101
101
  name: padrino-admin
102
102
  requirement: !ruby/object:Gem::Requirement
103
103
  requirements:
104
104
  - - '='
105
105
  - !ruby/object:Gem::Version
106
- version: 0.12.9
106
+ version: 0.13.0.beta1
107
107
  type: :runtime
108
108
  prerelease: false
109
109
  version_requirements: !ruby/object:Gem::Requirement
110
110
  requirements:
111
111
  - - '='
112
112
  - !ruby/object:Gem::Version
113
- version: 0.12.9
113
+ version: 0.13.0.beta1
114
114
  description: The Godfather of Sinatra provides a full-stack agnostic framework on
115
115
  top of Sinatra
116
116
  email: padrinorb@gmail.com
@@ -130,7 +130,7 @@ files:
130
130
  - subgems.rb
131
131
  - test/ext/minitest-spec.rb
132
132
  - test/ext/rack-test-methods.rb
133
- - test/padrino/test-methods.rb
133
+ - test/ext/rack-test-utils.rb
134
134
  - test/test_padrino.rb
135
135
  homepage: http://www.padrinorb.com
136
136
  licenses:
@@ -143,18 +143,23 @@ require_paths:
143
143
  - lib
144
144
  required_ruby_version: !ruby/object:Gem::Requirement
145
145
  requirements:
146
- - - ! '>='
146
+ - - '>='
147
147
  - !ruby/object:Gem::Version
148
148
  version: '0'
149
149
  required_rubygems_version: !ruby/object:Gem::Requirement
150
150
  requirements:
151
- - - ! '>='
151
+ - - '>'
152
152
  - !ruby/object:Gem::Version
153
- version: 1.3.6
153
+ version: 1.3.1
154
154
  requirements: []
155
155
  rubyforge_project: padrino
156
- rubygems_version: 2.6.14
156
+ rubygems_version: 2.0.6
157
157
  signing_key:
158
158
  specification_version: 4
159
159
  summary: The Godfather of Sinatra
160
- test_files: []
160
+ test_files:
161
+ - test/ext/minitest-spec.rb
162
+ - test/ext/rack-test-methods.rb
163
+ - test/ext/rack-test-utils.rb
164
+ - test/test_padrino.rb
165
+ has_rdoc:
@@ -1,55 +0,0 @@
1
- require 'oga'
2
-
3
- module Padrino
4
- module TestMethods
5
- def assert_html_has_tag(html, tag, attributes={})
6
- assert html.html_safe?, 'output in not #html_safe?'
7
- assert_has_selector(html, tag, attributes)
8
- end
9
-
10
- def assert_html_has_no_tag(html, tag, attributes={})
11
- assert html.html_safe?, 'output in not #html_safe?'
12
- assert_has_no_selector(html, tag, attributes)
13
- end
14
-
15
- def assert_response_has_tag(tag, attributes={})
16
- assert_has_selector(last_response.body, tag, attributes)
17
- end
18
-
19
- def assert_response_has_no_tag(tag, attributes={})
20
- assert_has_no_selector(last_response.body, tag, attributes)
21
- end
22
-
23
- def assert_has_selector(html, selector, attributes)
24
- count_requirement = attributes.delete(:count)
25
- message = "'#{selector}' with attributes #{attributes} in html\n#{html}"
26
- matched_count = html_matched_tags(html, selector.to_s, attributes)
27
- if count_requirement
28
- assert_equal count_requirement, matched_count, "count of tags #{message}"
29
- else
30
- assert matched_count > 0, "expected a tag #{message}"
31
- end
32
- end
33
-
34
- def assert_has_no_selector(html, selector, attributes)
35
- message = "'#{selector}' with attributes #{attributes} in html\n#{html}"
36
- matched_count = html_matched_tags(html, selector.to_s, attributes)
37
- assert matched_count == 0, "expected no tags #{message}"
38
- end
39
-
40
- private
41
-
42
- def html_matched_tags(html, selector, attributes)
43
- @dom ||= Oga.parse_html(html)
44
- content_requirement = attributes.delete(:content)
45
- attributes.each do |name, value|
46
- selector += %{[#{name}="#{value}"]}
47
- end
48
- tags = @dom.css(selector.to_s.gsub(/\[([^"']*?)=([^'"]*?)\]/, '[\1="\2"]'))
49
- if content_requirement
50
- tags = tags.select{ |tag| (tag.get('content') || tag.text).index(content_requirement) }
51
- end
52
- tags.count
53
- end
54
- end
55
- end