nhl_scores 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8ad5d2576599fd06f992809804a35a3d25ea9e20
4
- data.tar.gz: daa7df9594b8f60de4232c97051169b850ce3d0f
3
+ metadata.gz: c67227c1e469605e2db893679783f24476390229
4
+ data.tar.gz: e8b2b4f10aca8bb915b3857c28fc92a6751bbefd
5
5
  SHA512:
6
- metadata.gz: 6833e8001310bccde36a7260da9e5e6fe295551fde9fce864ad496e3662d3b7d86b519bf156cf263ac110ab3275e1e3cc1ada0ec6be84241d228a870b4a1dd09
7
- data.tar.gz: ee53ea6fde55a5e3465d8a5896089bfa7c0d8dc11e239f59bf14851a353c2de387933a05ac554f85b73813b26dc5d824a35e39f028ed84a53abd24384062f7a1
6
+ metadata.gz: 26557c5349bb88a9138a5fb5b24220d5542a376d75667da0259b5618e8a8c8e0c766e1c1f1e2926d30a776986a0382dbcd948bb5d075c73e66878f069d264f3c
7
+ data.tar.gz: e1ec9443e9807d5a753e29ae799d675616c6e3f309c8187f289dac12b76756158dccb5f03a5e09c7489060534482d06daf2227913ec4dc499b09ea58845022f6
data/Gemfile CHANGED
@@ -2,9 +2,8 @@ source "http://rubygems.org"
2
2
  # Add dependencies required to use your gem here.
3
3
  # Example:
4
4
  # gem "activesupport", ">= 2.3.5"
5
- gem "httparty"
6
- gem "thor"
7
-
5
+ gem "httparty", '~> 0.13'
6
+ gem "thor", '~> 0.19'
8
7
 
9
8
  # Add dependencies to develop your gem here.
10
9
  # Include everything needed to run rake, tests, features, etc.
@@ -12,5 +11,5 @@ group :development do
12
11
  gem "rspec", "~> 2.14"
13
12
  gem "rdoc", "~> 3.12"
14
13
  gem "bundler", "~> 1.0"
15
- gem "jeweler", "~> 1.8.7"
14
+ gem "jeweler", "~> 1.8"
16
15
  end
data/Gemfile.lock CHANGED
@@ -16,7 +16,7 @@ GEM
16
16
  oauth2
17
17
  hashie (2.0.5)
18
18
  highline (1.6.20)
19
- httparty (0.12.0)
19
+ httparty (0.13.3)
20
20
  json (~> 1.8)
21
21
  multi_xml (>= 0.5.2)
22
22
  httpauth (0.2.0)
@@ -55,15 +55,15 @@ GEM
55
55
  rspec-expectations (2.14.4)
56
56
  diff-lcs (>= 1.1.3, < 2.0)
57
57
  rspec-mocks (2.14.4)
58
- thor (0.18.1)
58
+ thor (0.19.1)
59
59
 
60
60
  PLATFORMS
61
61
  ruby
62
62
 
63
63
  DEPENDENCIES
64
64
  bundler (~> 1.0)
65
- httparty
66
- jeweler (~> 1.8.7)
65
+ httparty (~> 0.13)
66
+ jeweler (~> 1.8)
67
67
  rdoc (~> 3.12)
68
68
  rspec (~> 2.14)
69
- thor
69
+ thor (~> 0.19)
data/README.md CHANGED
@@ -5,9 +5,11 @@ NHL Scores
5
5
 
6
6
  Use Ruby to fetch details about recent, current, and upcoming regular season NHL matchups.
7
7
 
8
+ ![Example](https://raw.githubusercontent.com/tbloncar/nhl_scores/master/example.png)
9
+
8
10
  #### Installation
9
11
 
10
- Tested with `ruby-2.0.0-p247`.
12
+ Tested with `ruby-2.0`, `ruby-2.1`, and `ruby-2.2`.
11
13
 
12
14
  gem install nhl_scores
13
15
 
data/Rakefile CHANGED
@@ -22,8 +22,6 @@ Jeweler::Tasks.new do |gem|
22
22
  gem.email = "loncar.travis@gmail.com"
23
23
  gem.authors = ["Travis Loncar"]
24
24
  # dependencies defined in Gemfile
25
- gem.add_dependency 'httparty'
26
- gem.add_dependency 'thor'
27
25
  end
28
26
  Jeweler::RubygemsDotOrgTasks.new
29
27
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.1.1
data/example.png ADDED
Binary file
@@ -36,36 +36,36 @@ module NHLScores
36
36
  puts
37
37
  title = "#{type.upcase} NHL GAMES"
38
38
  underline = "-" * title.length
39
- puts title.align.yellow
40
- puts underline.align
39
+ puts TextHelpers.yellow(TextHelpers.align(title))
40
+ puts TextHelpers.align(underline)
41
41
  puts
42
42
  if games.any?
43
43
  games.each do |game|
44
44
  send("output_#{type}_game", game)
45
45
  end
46
46
  else
47
- puts "There are no #{type} games.".align
47
+ puts TextHelpers.align("There are no #{type} games.")
48
48
  end
49
49
  puts
50
50
  end
51
51
 
52
52
  def output_recent_game(game)
53
- puts "#{game.date}:".align + " #{game.winner} defeat #{game.loser} (#{game.winner_score}-#{game.loser_score})"
53
+ puts TextHelpers.align("#{game.date}:") + " #{game.winner} defeat #{game.loser} (#{game.winner_score}-#{game.loser_score})"
54
54
  end
55
55
 
56
56
  def output_current_game(game)
57
57
  if game.started?
58
58
  score_descriptor = score_descriptor_string(game)
59
- output = "IN PROGRESS:".align + " #{game.leader} #{score_descriptor} #{game.trailer} (#{game.leader_score}-#{game.trailer_score})"
59
+ output = TextHelpers.align("IN PROGRESS:") + " #{game.leader} #{score_descriptor} #{game.trailer} (#{game.leader_score}-#{game.trailer_score})"
60
60
  else
61
- output = "PRE GAME:".align + " #{game.home_team} vs. #{game.away_team}"
61
+ output = TextHelpers.align("PRE GAME:") + " #{game.home_team} vs. #{game.away_team}"
62
62
  end
63
63
  output += tv_string(game)
64
64
  puts output
65
65
  end
66
66
 
67
67
  def output_upcoming_game(game)
68
- output = "#{game.date} @ #{game.start_time} (EST):".align + " #{game.home_team} vs. #{game.away_team}"
68
+ output = TextHelpers.align("#{game.date} @ #{game.start_time} (EST):") + " #{game.home_team} vs. #{game.away_team}"
69
69
  output += tv_string(game)
70
70
  puts output
71
71
  end
@@ -82,4 +82,22 @@ module NHLScores
82
82
  return "lead"
83
83
  end
84
84
  end
85
+
86
+ class TextHelpers
87
+ class << self
88
+ def yellow(str)
89
+ color(str, "\e[0;33m")
90
+ end
91
+
92
+ def align(str)
93
+ str.rjust(32)
94
+ end
95
+
96
+ private
97
+
98
+ def color(text, color_code)
99
+ "#{color_code}#{text}\e[0m"
100
+ end
101
+ end
102
+ end
85
103
  end
data/lib/nhl_scores.rb CHANGED
@@ -38,15 +38,3 @@ module NHLScores
38
38
  wsh: "Washington Capitals"
39
39
  }
40
40
  end
41
-
42
- class String
43
- def yellow; color(self, "\e[0;33m"); end
44
-
45
- def color(text, color_code)
46
- "#{color_code}#{text}\e[0m"
47
- end
48
-
49
- def align
50
- self.rjust(32)
51
- end
52
- end
metadata CHANGED
@@ -1,127 +1,99 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nhl_scores
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Travis Loncar
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-29 00:00:00.000000000 Z
11
+ date: 2015-01-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
19
+ version: '0.13'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0'
26
+ version: '0.13'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: thor
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0'
33
+ version: '0.19'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '0'
40
+ version: '0.19'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ~>
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
47
  version: '2.14'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ~>
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '2.14'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rdoc
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ~>
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
61
  version: '3.12'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ~>
66
+ - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '3.12'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: bundler
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ~>
73
+ - - "~>"
74
74
  - !ruby/object:Gem::Version
75
75
  version: '1.0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ~>
80
+ - - "~>"
81
81
  - !ruby/object:Gem::Version
82
82
  version: '1.0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: jeweler
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ~>
87
+ - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: 1.8.7
89
+ version: '1.8'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - ~>
94
+ - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: 1.8.7
97
- - !ruby/object:Gem::Dependency
98
- name: httparty
99
- requirement: !ruby/object:Gem::Requirement
100
- requirements:
101
- - - '>='
102
- - !ruby/object:Gem::Version
103
- version: '0'
104
- type: :runtime
105
- prerelease: false
106
- version_requirements: !ruby/object:Gem::Requirement
107
- requirements:
108
- - - '>='
109
- - !ruby/object:Gem::Version
110
- version: '0'
111
- - !ruby/object:Gem::Dependency
112
- name: thor
113
- requirement: !ruby/object:Gem::Requirement
114
- requirements:
115
- - - '>='
116
- - !ruby/object:Gem::Version
117
- version: '0'
118
- type: :runtime
119
- prerelease: false
120
- version_requirements: !ruby/object:Gem::Requirement
121
- requirements:
122
- - - '>='
123
- - !ruby/object:Gem::Version
124
- version: '0'
96
+ version: '1.8'
125
97
  description: Use Ruby to grab live/recent NHL scores and upcoming matchup details.
126
98
  This gem ships with a minimal CLI.
127
99
  email: loncar.travis@gmail.com
@@ -132,9 +104,9 @@ extra_rdoc_files:
132
104
  - LICENSE.txt
133
105
  - README.md
134
106
  files:
135
- - .document
136
- - .rspec
137
- - .travis.yml
107
+ - ".document"
108
+ - ".rspec"
109
+ - ".travis.yml"
138
110
  - Gemfile
139
111
  - Gemfile.lock
140
112
  - LICENSE.txt
@@ -142,6 +114,7 @@ files:
142
114
  - Rakefile
143
115
  - VERSION
144
116
  - bin/nhl
117
+ - example.png
145
118
  - lib/nhl_scores.rb
146
119
  - lib/nhl_scores/cli.rb
147
120
  - lib/nhl_scores/game.rb
@@ -158,17 +131,17 @@ require_paths:
158
131
  - lib
159
132
  required_ruby_version: !ruby/object:Gem::Requirement
160
133
  requirements:
161
- - - '>='
134
+ - - ">="
162
135
  - !ruby/object:Gem::Version
163
136
  version: '0'
164
137
  required_rubygems_version: !ruby/object:Gem::Requirement
165
138
  requirements:
166
- - - '>='
139
+ - - ">="
167
140
  - !ruby/object:Gem::Version
168
141
  version: '0'
169
142
  requirements: []
170
143
  rubyforge_project:
171
- rubygems_version: 2.0.6
144
+ rubygems_version: 2.4.5
172
145
  signing_key:
173
146
  specification_version: 4
174
147
  summary: Use Ruby to grab live/recent NHL scores and upcoming matchup details.