padrino 0.12.8 → 0.12.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,15 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 14729bcfe2daee168f45939c8a63f9d9f6b0c3ef
4
- data.tar.gz: 5cbfff6237d88ef78be05249eee4545fcdd6f5ea
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ OTNiZTA1OGM0ODRiNDNmZWY0ZDFlNmMzODZiZTc0Y2Q0YTU4YWZkNw==
5
+ data.tar.gz: !binary |-
6
+ OWI1NmY2ZTQ0NzE3ZDA5Yjk4ODI2YTM2OGI3MTZmZjMxOWYzYjhhMA==
5
7
  SHA512:
6
- metadata.gz: bb0a67196d798b23aca145978fa7c97022db1ea66205d61f728448c630770bb8bc89da31895f3f389897c85152d6a637c4a74222e408b46747431f6ca23a5cc5
7
- data.tar.gz: ee2a0191fd1f659650f6eb40596502c4ec4ce476eb4f861013e7ce88117720041f1249fb67f5c52b26e877be785bc56f70ba361ba0ffad7c7b700d75aec80e30
8
+ metadata.gz: !binary |-
9
+ ZTU1MTc0YmRiM2RhYmZkOWY1ZTg5MjhkYzhhOTQ5MDdjZmY5YTA4OTg4ZWNm
10
+ MTE1ZDk1ZWJhYWY3NjJhOWM0ODY4NGEzMWI5MzQ0NDUwMGU0NTVhZTFmYzAz
11
+ YjQwMWUzMDU5MjViOGQ3OTgxZmEwNzY0Yjg0YWE2OTkyYmIyZWE=
12
+ data.tar.gz: !binary |-
13
+ ZDM5MzI0YmVlZTVkOWM2MjI2N2Q5NGE5NjFkMDBjYzk4ZWNhMDRlYjNiYzMw
14
+ ODFkYmE1MmE5ZmYyM2E3ZDU3NGM1NzY4ZTU5OTlmODMzMGY2OGM2ZDhhMTNm
15
+ NmZlMzUyZDExODgwNjU3ODFhODc1Mzc2OTg4NTFhNDcyMmEzZWI=
data/Rakefile CHANGED
@@ -1,32 +1,16 @@
1
- # coding:utf-8
2
- RAKE_ROOT = __FILE__
3
-
4
- require 'rubygems'
5
1
  require File.expand_path(File.dirname(__FILE__) + '/../gem_rake_helper')
6
2
 
7
3
  ########### CUSTOM TASKS ##########
8
4
 
9
- gemspec = ::Gem::Specification.load(File.expand_path(File.dirname(__FILE__) + "/padrino.gemspec"))
10
- subgems = [
11
- ["padrino-core", "= #{gemspec.version}"],
12
- ["padrino-helpers", "= #{gemspec.version}"],
13
- ["padrino-mailer", "= #{gemspec.version}"],
14
- ["padrino-gen", "= #{gemspec.version}"],
15
- ["padrino-admin", "= #{gemspec.version}"],
16
- ["padrino-cache", "= #{gemspec.version}"],
17
- ["padrino-support", "= #{gemspec.version}"],
18
- ]
19
-
20
5
  task :package => "lib/padrino.rb"
21
6
 
22
7
  desc "Create padrino.rb"
23
8
  task "lib/padrino.rb" do
24
- mkdir_p "lib"
9
+ FileUtils.mkdir_p "lib"
25
10
  File.open("lib/padrino.rb","w+") do |file|
26
- file.puts "### AUTOMATICALLY GENERATED. DO NOT EDIT!"
27
- subgems.each do |pair|
28
- g, _ = pair
29
- file.puts "require '#{g}'" unless g =~ /padrino-gen/
11
+ file.puts "# Automatically generated from 'padrino.gemspec' by `rake lib/padrino.rb`"
12
+ PADRINO_SUBGEMS.each_key do |name|
13
+ file.puts "require '#{name}'" unless name =~ /padrino-(gen|performance)/
30
14
  end
31
15
  end
32
- end
16
+ end
@@ -1,7 +1,7 @@
1
- ### AUTOMATICALLY GENERATED. DO NOT EDIT!
1
+ # Automatically generated from 'padrino.gemspec' by `rake lib/padrino.rb`
2
2
  require 'padrino-support'
3
3
  require 'padrino-core'
4
- require 'padrino-mailer'
5
4
  require 'padrino-helpers'
6
- require 'padrino-admin'
7
5
  require 'padrino-cache'
6
+ require 'padrino-mailer'
7
+ require 'padrino-admin'
@@ -24,11 +24,13 @@ Gem::Specification.new do |s|
24
24
  s.require_paths = ["lib"]
25
25
  s.rdoc_options = ["--charset=UTF-8"]
26
26
 
27
- s.add_dependency("padrino-core", Padrino.version)
28
27
  s.add_dependency("padrino-support", Padrino.version)
28
+ s.add_dependency("padrino-core", Padrino.version)
29
29
  s.add_dependency("padrino-helpers", Padrino.version)
30
+ s.add_dependency("padrino-cache", Padrino.version)
30
31
  s.add_dependency("padrino-mailer", Padrino.version)
31
32
  s.add_dependency("padrino-gen", Padrino.version)
32
- s.add_dependency("padrino-cache", Padrino.version)
33
33
  s.add_dependency("padrino-admin", Padrino.version)
34
+
35
+ # add independent padrino gems to 'subgems.rb'
34
36
  end
@@ -0,0 +1,9 @@
1
+ padrino_gemspec = ::Gem::Specification.load(File.expand_path(File.dirname(__FILE__) + "/padrino.gemspec"))
2
+ performance_gemspec = ::Gem::Specification.load(File.expand_path(File.dirname(__FILE__) + "/../padrino-performance/padrino-performance.gemspec"))
3
+
4
+ PADRINO_SUBGEMS ||= Hash[padrino_gemspec.dependencies.map{ |gem| [gem.name, gem.requirement.to_s] }]
5
+
6
+ PADRINO_GEMS ||= PADRINO_SUBGEMS.merge(
7
+ 'padrino' => padrino_gemspec.version.to_s,
8
+ 'padrino-performance' => performance_gemspec.version.to_s,
9
+ )
@@ -0,0 +1,30 @@
1
+ class MiniTest::Spec
2
+ # Assert_file_exists('/tmp/app')
3
+ def assert_file_exists(file_path)
4
+ assert File.file?(file_path), "File at path '#{file_path}' does not exist!"
5
+ end
6
+
7
+ # Assert_no_file_exists('/tmp/app')
8
+ def assert_no_file_exists(file_path)
9
+ assert !File.exist?(file_path), "File should not exist at path '#{file_path}' but was found!"
10
+ end
11
+
12
+ # assert_dir_exists('/tmp/app')
13
+ def assert_dir_exists(file_path)
14
+ assert File.directory?(file_path), "Folder at path '#{file_path}' does not exist"
15
+ end
16
+
17
+ # assert_no_dir_exists('/tmp/app')
18
+ def assert_no_dir_exists(file_path)
19
+ assert !File.exist?(file_path), "Folder should not exist at path '#{file_path}' but was found"
20
+ end
21
+
22
+ # Asserts that a file matches the pattern
23
+ def assert_match_in_file(pattern, file)
24
+ File.file?(file) ? assert_match(pattern, File.read(file)) : assert_file_exists(file)
25
+ end
26
+
27
+ def assert_no_match_in_file(pattern, file)
28
+ File.file?(file) ? refute_match(pattern, File.read(file)) : assert_file_exists(file)
29
+ end
30
+ end
@@ -0,0 +1,10 @@
1
+ module Rack::Test::Methods
2
+ # Delegate some methods to the last response
3
+ alias_method :response, :last_response
4
+
5
+ [:status, :headers, :body, :content_type, :ok?, :forbidden?].each do |method_name|
6
+ define_method method_name do
7
+ last_response.send(method_name)
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,55 @@
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
@@ -1,11 +1,12 @@
1
- require File.expand_path(File.dirname(__FILE__) + '/helper')
1
+ require 'minitest/autorun'
2
+ require 'minitest/pride'
2
3
 
3
4
  describe "Padrino" do
4
- should "be a metagem that requires subgems" do
5
+ it "should be a metagem that requires subgems" do
5
6
  assert_nil defined?(Padrino::Mailer)
6
7
  assert_nil defined?(Padrino::Helpers)
7
8
  require File.expand_path('../../lib/padrino.rb', __FILE__)
8
- assert_not_nil defined?(Padrino::Mailer)
9
- assert_not_nil defined?(Padrino::Helpers)
9
+ refute_nil defined?(Padrino::Mailer)
10
+ refute_nil defined?(Padrino::Helpers)
10
11
  end
11
12
  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.8
4
+ version: 0.12.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Padrino Team
@@ -11,106 +11,106 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2016-06-08 00:00:00.000000000 Z
14
+ date: 2018-02-23 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
- name: padrino-core
17
+ name: padrino-support
18
18
  requirement: !ruby/object:Gem::Requirement
19
19
  requirements:
20
20
  - - '='
21
21
  - !ruby/object:Gem::Version
22
- version: 0.12.8
22
+ version: 0.12.9
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.8
29
+ version: 0.12.9
30
30
  - !ruby/object:Gem::Dependency
31
- name: padrino-support
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.8
36
+ version: 0.12.9
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.8
43
+ version: 0.12.9
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.8
50
+ version: 0.12.9
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.8
57
+ version: 0.12.9
58
58
  - !ruby/object:Gem::Dependency
59
- name: padrino-mailer
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.8
64
+ version: 0.12.9
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.8
71
+ version: 0.12.9
72
72
  - !ruby/object:Gem::Dependency
73
- name: padrino-gen
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.8
78
+ version: 0.12.9
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.8
85
+ version: 0.12.9
86
86
  - !ruby/object:Gem::Dependency
87
- name: padrino-cache
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.8
92
+ version: 0.12.9
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.8
99
+ version: 0.12.9
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.8
106
+ version: 0.12.9
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.8
113
+ version: 0.12.9
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
@@ -119,15 +119,18 @@ extensions: []
119
119
  extra_rdoc_files:
120
120
  - README.rdoc
121
121
  files:
122
- - ".document"
123
- - ".gitignore"
124
- - ".yardopts"
122
+ - .document
123
+ - .gitignore
124
+ - .yardopts
125
125
  - LICENSE.txt
126
126
  - README.rdoc
127
127
  - Rakefile
128
128
  - lib/padrino.rb
129
129
  - padrino.gemspec
130
- - test/helper.rb
130
+ - subgems.rb
131
+ - test/ext/minitest-spec.rb
132
+ - test/ext/rack-test-methods.rb
133
+ - test/padrino/test-methods.rb
131
134
  - test/test_padrino.rb
132
135
  homepage: http://www.padrinorb.com
133
136
  licenses:
@@ -135,24 +138,23 @@ licenses:
135
138
  metadata: {}
136
139
  post_install_message:
137
140
  rdoc_options:
138
- - "--charset=UTF-8"
141
+ - --charset=UTF-8
139
142
  require_paths:
140
143
  - lib
141
144
  required_ruby_version: !ruby/object:Gem::Requirement
142
145
  requirements:
143
- - - ">="
146
+ - - ! '>='
144
147
  - !ruby/object:Gem::Version
145
148
  version: '0'
146
149
  required_rubygems_version: !ruby/object:Gem::Requirement
147
150
  requirements:
148
- - - ">="
151
+ - - ! '>='
149
152
  - !ruby/object:Gem::Version
150
153
  version: 1.3.6
151
154
  requirements: []
152
155
  rubyforge_project: padrino
153
- rubygems_version: 2.6.4
156
+ rubygems_version: 2.6.14
154
157
  signing_key:
155
158
  specification_version: 4
156
159
  summary: The Godfather of Sinatra
157
160
  test_files: []
158
- has_rdoc:
@@ -1,6 +0,0 @@
1
- require File.expand_path('../../../load_paths', __FILE__)
2
- require File.join(File.dirname(__FILE__), '..', '..', 'padrino-core', 'test', 'mini_shoulda')
3
-
4
- class MiniTest::Spec
5
- # Nothing to see here
6
- end