url2png 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --color
data/Gemfile CHANGED
@@ -6,7 +6,7 @@ source "http://rubygems.org"
6
6
  # Add dependencies to develop your gem here.
7
7
  # Include everything needed to run rake, tests, features, etc.
8
8
  group :development do
9
- gem "shoulda", ">= 0"
9
+ gem "rspec", "~> 2.6.0"
10
10
  gem "bundler", "~> 1.0.0"
11
11
  gem "jeweler", "~> 1.5.2"
12
12
  gem "rcov", ">= 0"
data/Gemfile.lock CHANGED
@@ -1,6 +1,7 @@
1
1
  GEM
2
2
  remote: http://rubygems.org/
3
3
  specs:
4
+ diff-lcs (1.1.2)
4
5
  git (1.2.5)
5
6
  jeweler (1.5.2)
6
7
  bundler (~> 1.0.0)
@@ -8,7 +9,14 @@ GEM
8
9
  rake
9
10
  rake (0.8.7)
10
11
  rcov (0.9.9)
11
- shoulda (2.11.3)
12
+ rspec (2.6.0)
13
+ rspec-core (~> 2.6.0)
14
+ rspec-expectations (~> 2.6.0)
15
+ rspec-mocks (~> 2.6.0)
16
+ rspec-core (2.6.3)
17
+ rspec-expectations (2.6.0)
18
+ diff-lcs (~> 1.1.2)
19
+ rspec-mocks (2.6.0)
12
20
 
13
21
  PLATFORMS
14
22
  ruby
@@ -17,4 +25,4 @@ DEPENDENCIES
17
25
  bundler (~> 1.0.0)
18
26
  jeweler (~> 1.5.2)
19
27
  rcov
20
- shoulda
28
+ rspec (~> 2.6.0)
data/Rakefile CHANGED
@@ -27,21 +27,18 @@ Jeweler::Tasks.new do |gem|
27
27
  end
28
28
  Jeweler::RubygemsDotOrgTasks.new
29
29
 
30
- require 'rake/testtask'
31
- Rake::TestTask.new(:test) do |test|
32
- test.libs << 'lib' << 'test'
33
- test.pattern = 'test/**/test_*.rb'
34
- test.verbose = true
30
+ require 'rspec/core'
31
+ require 'rspec/core/rake_task'
32
+ RSpec::Core::RakeTask.new(:spec) do |spec|
33
+ spec.pattern = FileList['spec/**/*_spec.rb']
35
34
  end
36
35
 
37
- require 'rcov/rcovtask'
38
- Rcov::RcovTask.new do |test|
39
- test.libs << 'test'
40
- test.pattern = 'test/**/test_*.rb'
41
- test.verbose = true
36
+ RSpec::Core::RakeTask.new(:rcov) do |spec|
37
+ spec.pattern = 'spec/**/*_spec.rb'
38
+ spec.rcov = true
42
39
  end
43
40
 
44
- task :default => :test
41
+ task :default => :spec
45
42
 
46
43
  require 'rake/rdoctask'
47
44
  Rake::RDocTask.new do |rdoc|
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.4
1
+ 0.0.5
@@ -1,8 +1,8 @@
1
1
  module Url2png
2
2
  module Config
3
3
 
4
- def self.api_url
5
- Thread.current[:url2png_url] ||= 'http://api.url2png.com'
4
+ def self.api_url protocol = 'http://'
5
+ Thread.current[:url2png_url] ||= "#{ protocol }api.url2png.com"
6
6
  end
7
7
 
8
8
  def self.api_version
@@ -27,7 +27,7 @@ module Url2png
27
27
  token = Digest::MD5.hexdigest("#{ Url2png::Config.shared_secret }+#{ safe_url }")
28
28
 
29
29
  # build image url
30
- File.join(Url2png::Config.api_url, Url2png::Config.api_version, Url2png::Config.public_key, token, dim[:size], safe_url)
30
+ File.join(Url2png::Config.api_url(request.protocol), Url2png::Config.api_version, Url2png::Config.public_key, token, dim[:size], safe_url)
31
31
  end
32
32
 
33
33
  end
data/lib/url2png/rails.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  require File.join(File.dirname(__FILE__), 'helpers', 'common')
2
2
 
3
- ActionView::Base.send(:include, Url2png::Helpers::Common)
3
+ ActionView::Base.send(:include, Url2png::Helpers::Common) if defined? ActionView
@@ -0,0 +1,12 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
2
+ require File.expand_path(File.dirname(__FILE__) + '/../../lib/url2png/helpers/common.rb')
3
+
4
+ describe Url2png do
5
+ include Url2png::Helpers::Common
6
+
7
+ describe "site_image_tag" do
8
+ it "should return the url of the http://pasparout.com image" do
9
+ site_image_tag('http://pasparout.com').should_not be_nil
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
2
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
3
+ require 'rspec'
4
+ require 'url2png'
5
+
6
+ # Requires supporting files with custom matchers and macros, etc,
7
+ # in ./support/ and its subdirectories.
8
+ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
9
+
10
+ RSpec.configure do |config|
11
+
12
+ end
@@ -0,0 +1,7 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
+
3
+ describe "Url2png" do
4
+ it "fails" do
5
+ fail "hey buddy, you should probably rename this file and start specing for real"
6
+ end
7
+ end
data/url2png.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{url2png}
8
- s.version = "0.0.4"
8
+ s.version = "0.0.5"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["wout fierens"]
12
- s.date = %q{2011-05-25}
12
+ s.date = %q{2011-06-23}
13
13
  s.description = %q{Generate screenshots from websites almost instantly at any preferred size using ruby and the url2png.com API}
14
14
  s.email = %q{wout@boysabroad.com}
15
15
  s.extra_rdoc_files = [
@@ -18,6 +18,7 @@ Gem::Specification.new do |s|
18
18
  ]
19
19
  s.files = [
20
20
  ".document",
21
+ ".rspec",
21
22
  "Gemfile",
22
23
  "Gemfile.lock",
23
24
  "LICENSE.txt",
@@ -29,8 +30,9 @@ Gem::Specification.new do |s|
29
30
  "lib/url2png/dimensions.rb",
30
31
  "lib/url2png/helpers/common.rb",
31
32
  "lib/url2png/rails.rb",
32
- "test/helper.rb",
33
- "test/test_url2png.rb",
33
+ "spec/helpers/common_rspec.rb",
34
+ "spec/spec_helper.rb",
35
+ "spec/url2png_spec.rb",
34
36
  "url2png.gemspec"
35
37
  ]
36
38
  s.homepage = %q{http://github.com/wout/url2png-gem}
@@ -39,8 +41,9 @@ Gem::Specification.new do |s|
39
41
  s.rubygems_version = %q{1.3.7}
40
42
  s.summary = %q{A ruby gem wrapping the url2png.com screenshot service API}
41
43
  s.test_files = [
42
- "test/helper.rb",
43
- "test/test_url2png.rb"
44
+ "spec/helpers/common_rspec.rb",
45
+ "spec/spec_helper.rb",
46
+ "spec/url2png_spec.rb"
44
47
  ]
45
48
 
46
49
  if s.respond_to? :specification_version then
@@ -48,20 +51,20 @@ Gem::Specification.new do |s|
48
51
  s.specification_version = 3
49
52
 
50
53
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
51
- s.add_development_dependency(%q<shoulda>, [">= 0"])
54
+ s.add_development_dependency(%q<rspec>, ["~> 2.6.0"])
52
55
  s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
53
56
  s.add_development_dependency(%q<jeweler>, ["~> 1.5.2"])
54
57
  s.add_development_dependency(%q<rcov>, [">= 0"])
55
58
  s.add_development_dependency(%q<rspec>, ["> 2.6.0"])
56
59
  else
57
- s.add_dependency(%q<shoulda>, [">= 0"])
60
+ s.add_dependency(%q<rspec>, ["~> 2.6.0"])
58
61
  s.add_dependency(%q<bundler>, ["~> 1.0.0"])
59
62
  s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
60
63
  s.add_dependency(%q<rcov>, [">= 0"])
61
64
  s.add_dependency(%q<rspec>, ["> 2.6.0"])
62
65
  end
63
66
  else
64
- s.add_dependency(%q<shoulda>, [">= 0"])
67
+ s.add_dependency(%q<rspec>, ["~> 2.6.0"])
65
68
  s.add_dependency(%q<bundler>, ["~> 1.0.0"])
66
69
  s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
67
70
  s.add_dependency(%q<rcov>, [">= 0"])
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 4
9
- version: 0.0.4
8
+ - 5
9
+ version: 0.0.5
10
10
  platform: ruby
11
11
  authors:
12
12
  - wout fierens
@@ -14,19 +14,21 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2011-05-25 00:00:00 +01:00
17
+ date: 2011-06-23 00:00:00 +01:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
- name: shoulda
21
+ name: rspec
22
22
  requirement: &id001 !ruby/object:Gem::Requirement
23
23
  none: false
24
24
  requirements:
25
- - - ">="
25
+ - - ~>
26
26
  - !ruby/object:Gem::Version
27
27
  segments:
28
+ - 2
29
+ - 6
28
30
  - 0
29
- version: "0"
31
+ version: 2.6.0
30
32
  type: :development
31
33
  prerelease: false
32
34
  version_requirements: *id001
@@ -99,6 +101,7 @@ extra_rdoc_files:
99
101
  - README.markdown
100
102
  files:
101
103
  - .document
104
+ - .rspec
102
105
  - Gemfile
103
106
  - Gemfile.lock
104
107
  - LICENSE.txt
@@ -110,8 +113,9 @@ files:
110
113
  - lib/url2png/dimensions.rb
111
114
  - lib/url2png/helpers/common.rb
112
115
  - lib/url2png/rails.rb
113
- - test/helper.rb
114
- - test/test_url2png.rb
116
+ - spec/helpers/common_rspec.rb
117
+ - spec/spec_helper.rb
118
+ - spec/url2png_spec.rb
115
119
  - url2png.gemspec
116
120
  has_rdoc: true
117
121
  homepage: http://github.com/wout/url2png-gem
@@ -127,7 +131,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
127
131
  requirements:
128
132
  - - ">="
129
133
  - !ruby/object:Gem::Version
130
- hash: 2737594852443205245
134
+ hash: -2135920408617122627
131
135
  segments:
132
136
  - 0
133
137
  version: "0"
@@ -147,5 +151,6 @@ signing_key:
147
151
  specification_version: 3
148
152
  summary: A ruby gem wrapping the url2png.com screenshot service API
149
153
  test_files:
150
- - test/helper.rb
151
- - test/test_url2png.rb
154
+ - spec/helpers/common_rspec.rb
155
+ - spec/spec_helper.rb
156
+ - spec/url2png_spec.rb
data/test/helper.rb DELETED
@@ -1,18 +0,0 @@
1
- require 'rubygems'
2
- require 'bundler'
3
- begin
4
- Bundler.setup(:default, :development)
5
- rescue Bundler::BundlerError => e
6
- $stderr.puts e.message
7
- $stderr.puts "Run `bundle install` to install missing gems"
8
- exit e.status_code
9
- end
10
- require 'test/unit'
11
- require 'shoulda'
12
-
13
- $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
14
- $LOAD_PATH.unshift(File.dirname(__FILE__))
15
- require 'url2png'
16
-
17
- class Test::Unit::TestCase
18
- end
data/test/test_url2png.rb DELETED
@@ -1,7 +0,0 @@
1
- require 'helper'
2
-
3
- class TestUrl2png < Test::Unit::TestCase
4
- should "probably rename this file and start testing for real" do
5
- flunk "hey buddy, you should probably rename this file and start testing for real"
6
- end
7
- end