mechanize_content 0.2.0 → 0.2.1

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
@@ -1,3 +1,3 @@
1
1
  module MechanizeContent
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
@@ -10,7 +10,7 @@ module MechanizeContent
10
10
  attr_accessor :urls
11
11
 
12
12
  def initialize(*args)
13
- @urls = *args
13
+ @urls = *args.flatten
14
14
  end
15
15
 
16
16
  def best_title
@@ -20,6 +20,6 @@ Gem::Specification.new do |s|
20
20
  s.require_paths = ["lib"]
21
21
  s.add_dependency("mechanize", "~> 1.0.0")
22
22
  s.add_dependency("imagesize", "~> 0.1.1")
23
- s.add_development_dependency('rspec', "~> 1.3.1")
24
- s.add_development_dependency('fakeweb', "1.2.5")
23
+ s.add_development_dependency('rspec', "~> 2.5.0")
24
+ s.add_development_dependency('fakeweb', "~> 1.3.0")
25
25
  end
@@ -162,6 +162,13 @@ describe "MechanizeContent" do
162
162
  mc3.best_image.should eql(nil)
163
163
  end
164
164
 
165
+ it "can handle arrays" do
166
+ mc = MechanizeContent::Parser.new(["http://www.rockstargames.com/newswire/2010/03/18/4061/episodes_from_liberty_city_now_coming_to_playstation_3_and_pc_this_april", "http://www.vg247.com/2010/03/18/gta-iv-episodes-from-liberty-city-sees-slight-delay-on-pc-and-ps3/"])
167
+ mc.best_title.should eql("Rockstar Games | Rockstar News Wire | Episodes from Liberty City Now Coming to PlayStation 3 and PC this April")
168
+ mc.best_text.should eql("Due to a last minute game submission request from Sony Computer Entertainment Europe to edit some of the in-game Liberty City radio station, television, and internet content – we are forced to delay the worldwide release of Grand Theft Auto: Episodes from Liberty City for both PlayStation 3 and PC for an extra two weeks.\rThe new release date for Episodes from Liberty City - and the two downloadable episodes The Lost and Damned and The Ballad of Gay Tony - on those platforms is now April 13th in North America and April 16th in Europe.  This new date will enable us to rectify these changes for Sony Europe, and still allow for a level playing field for all of the Grand Theft Auto fans that have been waiting patiently for this release.  In the meantime, we’re moving full speed ahead towards the new game release date.  On that note – please be aware that the Grand Theft Auto IV PlayStation 3 leaderboards at Rockstar Games Social Club will be down for maintenance for one week starting March 22nd as we work on their re-launch in support of Episodes from Liberty City.\rBelow are answers to some additional questions that we know some of you may have…\rThose game changes sound pretty minor.  Why does the game have to be delayed a whole two weeks?\rUnfortunately, with each round of changes comes fully re-testing the game and a full re-submission to PlayStation.  This is the nature of the game submission process.  Believe us, if we could expedite the turnaround any sooner – we would.  We are dying to get this game in the hands of fans who’ve waited for it for so long in the first place.Why is content being edited just for the European release?  This doesn’t seem fair.\rThere are different regional requirements for content – whether dictated by ratings boards like the ESRB and BBFC or by SCEE – this is pretty standard in the world of entertainment.\rIf this content is only being edited for the PlayStation 3 release, and only in Europe… why does everyone in North America etc have to wait?  And why do PC players have to wait at all?\rThis was a tough decision but with a simultaneous release, everyone can experience multiplayer simultaneously, take part in online events together, be on level ground on leaderboards, etc. What about those Episodes from Liberty City PSN and GFWL Social Club multiplayer events you announced for April 2nd and 3rd?  \rThe first Episodes events for those systems will now be on April 16th and 17th.  We will most likely replace the originally scheduled early April events with one for another game.  Any requests?\rAny other questions, please feel to leave in the Comments area and we’ll do our best to answer.  While this sort of thing may be commonplace in the world of interactive entertainment, we know that game delays are as disappointing to you all as they are to us – and we thank all of our fans immensely for their patience and understanding.\rRockstar Games")
169
+ mc.best_image.should eql("http://www.rockstargames.com/rockstar/local_data/US/img/news/eflc_luisjohnny.jpg")
170
+ end
171
+
165
172
  it "find the best content from multiple urls" do
166
173
  mc = MechanizeContent::Parser.new("http://www.rockstargames.com/newswire/2010/03/18/4061/episodes_from_liberty_city_now_coming_to_playstation_3_and_pc_this_april", "http://www.vg247.com/2010/03/18/gta-iv-episodes-from-liberty-city-sees-slight-delay-on-pc-and-ps3/")
167
174
  mc.best_title.should eql("Rockstar Games | Rockstar News Wire | Episodes from Liberty City Now Coming to PlayStation 3 and PC this April")
data/spec/spec_helper.rb CHANGED
@@ -1,11 +1,3 @@
1
- $LOAD_PATH.unshift(File.dirname(__FILE__))
2
- $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
3
1
  require 'mechanize_content'
4
- require 'spec'
5
- require 'spec/autorun'
6
2
  require "fakeweb"
7
- FakeWeb.allow_net_connect = false
8
-
9
- Spec::Runner.configure do |config|
10
-
11
- end
3
+ FakeWeb.allow_net_connect = false
metadata CHANGED
@@ -1,13 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mechanize_content
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
5
4
  prerelease:
6
- segments:
7
- - 0
8
- - 2
9
- - 0
10
- version: 0.2.0
5
+ version: 0.2.1
11
6
  platform: ruby
12
7
  authors:
13
8
  - John Griffin
@@ -15,8 +10,7 @@ autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
12
 
18
- date: 2011-02-26 00:00:00 +00:00
19
- default_executable:
13
+ date: 2011-04-28 00:00:00 Z
20
14
  dependencies:
21
15
  - !ruby/object:Gem::Dependency
22
16
  name: mechanize
@@ -26,11 +20,6 @@ dependencies:
26
20
  requirements:
27
21
  - - ~>
28
22
  - !ruby/object:Gem::Version
29
- hash: 23
30
- segments:
31
- - 1
32
- - 0
33
- - 0
34
23
  version: 1.0.0
35
24
  type: :runtime
36
25
  version_requirements: *id001
@@ -42,11 +31,6 @@ dependencies:
42
31
  requirements:
43
32
  - - ~>
44
33
  - !ruby/object:Gem::Version
45
- hash: 25
46
- segments:
47
- - 0
48
- - 1
49
- - 1
50
34
  version: 0.1.1
51
35
  type: :runtime
52
36
  version_requirements: *id002
@@ -58,12 +42,7 @@ dependencies:
58
42
  requirements:
59
43
  - - ~>
60
44
  - !ruby/object:Gem::Version
61
- hash: 25
62
- segments:
63
- - 1
64
- - 3
65
- - 1
66
- version: 1.3.1
45
+ version: 2.5.0
67
46
  type: :development
68
47
  version_requirements: *id003
69
48
  - !ruby/object:Gem::Dependency
@@ -72,14 +51,9 @@ dependencies:
72
51
  requirement: &id004 !ruby/object:Gem::Requirement
73
52
  none: false
74
53
  requirements:
75
- - - "="
54
+ - - ~>
76
55
  - !ruby/object:Gem::Version
77
- hash: 21
78
- segments:
79
- - 1
80
- - 2
81
- - 5
82
- version: 1.2.5
56
+ version: 1.3.0
83
57
  type: :development
84
58
  version_requirements: *id004
85
59
  description: pass in a url or urls and mechanize-content will select the best block of text, image and title by analysing the page content
@@ -93,6 +67,7 @@ extra_rdoc_files: []
93
67
 
94
68
  files:
95
69
  - .gitignore
70
+ - .rspec
96
71
  - Gemfile
97
72
  - LICENSE
98
73
  - README.rdoc
@@ -121,9 +96,7 @@ files:
121
96
  - spec/fixtures/witcher.html
122
97
  - spec/fixtures/xbox-360-gaining-usb-storage-support-in-2010-update.html
123
98
  - spec/mechanize-content_spec.rb
124
- - spec/spec.opts
125
99
  - spec/spec_helper.rb
126
- has_rdoc: true
127
100
  homepage: http://github.com/john-griffin/mechanize-content
128
101
  licenses: []
129
102
 
@@ -137,23 +110,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
137
110
  requirements:
138
111
  - - ">="
139
112
  - !ruby/object:Gem::Version
140
- hash: 3
141
- segments:
142
- - 0
143
113
  version: "0"
144
114
  required_rubygems_version: !ruby/object:Gem::Requirement
145
115
  none: false
146
116
  requirements:
147
117
  - - ">="
148
118
  - !ruby/object:Gem::Version
149
- hash: 3
150
- segments:
151
- - 0
152
119
  version: "0"
153
120
  requirements: []
154
121
 
155
122
  rubyforge_project: mechanize_content
156
- rubygems_version: 1.5.2
123
+ rubygems_version: 1.7.2
157
124
  signing_key:
158
125
  specification_version: 3
159
126
  summary: scrape the best content from a page
@@ -178,5 +145,4 @@ test_files:
178
145
  - spec/fixtures/witcher.html
179
146
  - spec/fixtures/xbox-360-gaining-usb-storage-support-in-2010-update.html
180
147
  - spec/mechanize-content_spec.rb
181
- - spec/spec.opts
182
148
  - spec/spec_helper.rb
data/spec/spec.opts DELETED
@@ -1 +0,0 @@
1
- --color