everoute 0.0.2 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.2
1
+ 0.1.0
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "everoute"
8
- s.version = "0.0.2"
8
+ s.version = "0.1.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Daniel Trierweiler"]
@@ -29,6 +29,7 @@ Gem::Specification.new do |s|
29
29
  "lib/everoute.rb",
30
30
  "lib/evesystem.rb",
31
31
  "pkg/everoute-0.0.1.gem",
32
+ "pkg/everoute-0.0.2.gem",
32
33
  "spec/everoute_spec.rb",
33
34
  "spec/evesystem_spec.rb",
34
35
  "spec/spec_helper.rb"
@@ -14,12 +14,15 @@ class Everoute
14
14
  @agent = Mechanize.new
15
15
  end
16
16
 
17
- def travel(system_arr)
18
- sys_string = system_arr[0].clone
17
+ def travel(system_arr, hisec=0)
18
+ sys_string = ""
19
+ sys_string << "2:" if hisec == "1"
20
+ sys_string << system_arr[0]
19
21
  system_arr.each_with_index do |sys, i|
20
22
  next if i == 0
21
23
  sys_string << ":" + sys
22
24
  end
25
+ puts sys_string
23
26
  page = @agent.get BASE_URL+sys_string
24
27
  arr = page.parser.xpath('//html/body/div/div/div[2]/div[2]/div/div/table/tr')
25
28
  route = []
@@ -33,11 +36,11 @@ class Everoute
33
36
  route
34
37
  end
35
38
 
36
- def find_tradehubs(start_sys)
39
+ def find_tradehubs(start_sys, hisec)
37
40
  output = ""
38
41
  TRADEHUBS.each do |hub|
39
42
  temp_arr = [start_sys, hub]
40
- route = travel(temp_arr)
43
+ route = travel(temp_arr, hisec)
41
44
  output << "#{hub}: #{route.size} "
42
45
  end
43
46
  output
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: everoute
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2011-12-29 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: nokogiri
16
- requirement: &80754530 !ruby/object:Gem::Requirement
16
+ requirement: &82663650 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *80754530
24
+ version_requirements: *82663650
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: mechanize
27
- requirement: &80754170 !ruby/object:Gem::Requirement
27
+ requirement: &82663360 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *80754170
35
+ version_requirements: *82663360
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: shoulda
38
- requirement: &80753860 !ruby/object:Gem::Requirement
38
+ requirement: &82663040 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *80753860
46
+ version_requirements: *82663040
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: bundler
49
- requirement: &80753550 !ruby/object:Gem::Requirement
49
+ requirement: &82662800 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ~>
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: 1.0.0
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *80753550
57
+ version_requirements: *82662800
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: jeweler
60
- requirement: &80753180 !ruby/object:Gem::Requirement
60
+ requirement: &82662510 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ~>
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: 1.6.4
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *80753180
68
+ version_requirements: *82662510
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rcov
71
- requirement: &80752820 !ruby/object:Gem::Requirement
71
+ requirement: &82662220 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ! '>='
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: '0'
77
77
  type: :development
78
78
  prerelease: false
79
- version_requirements: *80752820
79
+ version_requirements: *82662220
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: rspec
82
- requirement: &80752490 !ruby/object:Gem::Requirement
82
+ requirement: &82661920 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ! '>='
@@ -87,7 +87,7 @@ dependencies:
87
87
  version: '0'
88
88
  type: :development
89
89
  prerelease: false
90
- version_requirements: *80752490
90
+ version_requirements: *82661920
91
91
  description: Parses the evemaps website and makes these information available in Ruby
92
92
  email: trierweiler@dievision.de
93
93
  executables: []
@@ -108,6 +108,7 @@ files:
108
108
  - lib/everoute.rb
109
109
  - lib/evesystem.rb
110
110
  - pkg/everoute-0.0.1.gem
111
+ - pkg/everoute-0.0.2.gem
111
112
  - spec/everoute_spec.rb
112
113
  - spec/evesystem_spec.rb
113
114
  - spec/spec_helper.rb
@@ -126,7 +127,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
126
127
  version: '0'
127
128
  segments:
128
129
  - 0
129
- hash: 786954127
130
+ hash: -665735697
130
131
  required_rubygems_version: !ruby/object:Gem::Requirement
131
132
  none: false
132
133
  requirements: