hyperscore 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/.gitignore CHANGED
@@ -2,12 +2,9 @@
2
2
  *.rbc
3
3
  .bundle
4
4
  .config
5
- .yardoc
6
5
  Gemfile.lock
7
6
  InstalledFiles
8
- _yardoc
9
7
  coverage
10
- doc/
11
8
  lib/bundler/man
12
9
  pkg
13
10
  rdoc
@@ -15,3 +12,11 @@ spec/reports
15
12
  test/tmp
16
13
  test/version_tmp
17
14
  tmp
15
+
16
+ # YARD artifacts
17
+ .yardoc
18
+ _yardoc
19
+ doc/
20
+
21
+ # OS X
22
+ .DS_Store
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Hyperscore
2
2
 
3
- TODO: Write a gem description
3
+ Browser Cyberscore's API in style.
4
4
 
5
5
  ## Installation
6
6
 
@@ -18,7 +18,11 @@ Or install it yourself as:
18
18
 
19
19
  ## Usage
20
20
 
21
- TODO: Write usage instructions here
21
+ ```ruby
22
+ require 'hyperscore'
23
+
24
+ client = Hyperscore::Client.new
25
+ ```
22
26
 
23
27
  ## Contributing
24
28
 
@@ -16,6 +16,7 @@ Gem::Specification.new do |gem|
16
16
  gem.version = Hyperscore::VERSION
17
17
 
18
18
  gem.add_runtime_dependency "hyperclient"
19
+ gem.add_runtime_dependency "virtus"
19
20
 
20
21
  gem.add_development_dependency "pry"
21
22
  end
@@ -1,7 +1,10 @@
1
+ require 'bundler/setup'
2
+
1
3
  require "hyperscore/version"
2
4
 
3
5
  module Hyperscore
4
6
  # Your code goes here...
5
7
  end
6
8
 
7
- require_relative 'hyperscore/client'
9
+ require_relative 'hyperscore/client'
10
+ require_relative 'hyperscore/coercions'
@@ -0,0 +1,29 @@
1
+ require 'hyperclient'
2
+
3
+ module Hyperscore
4
+
5
+ class Client
6
+ include Hyperclient
7
+
8
+ entry_point 'http://cs-api.heroku.com/api/'
9
+
10
+ def news
11
+ links.news.resources.news.map do |news|
12
+ Hyperscore::Coercions::News.new( news.attributes )
13
+ end
14
+ end
15
+
16
+ def submissions
17
+ links.submissions.resources.submissions
18
+ end
19
+
20
+ def games
21
+ links.games.resources.games
22
+ end
23
+
24
+ def motd
25
+ attributes['motd']
26
+ end
27
+ end
28
+
29
+ end
@@ -0,0 +1,13 @@
1
+ require 'virtus'
2
+
3
+ module Hyperscore::Coercions
4
+
5
+ class News
6
+ include Virtus
7
+
8
+ attribute :id, Integer
9
+ attribute :headline, String
10
+ attribute :date, Date
11
+ end
12
+
13
+ end
@@ -1,3 +1,3 @@
1
1
  module Hyperscore
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hyperscore
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-06-15 00:00:00.000000000 Z
12
+ date: 2012-06-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: hyperclient
@@ -27,6 +27,22 @@ dependencies:
27
27
  - - ! '>='
28
28
  - !ruby/object:Gem::Version
29
29
  version: '0'
30
+ - !ruby/object:Gem::Dependency
31
+ name: virtus
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ type: :runtime
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
30
46
  - !ruby/object:Gem::Dependency
31
47
  name: pry
32
48
  requirement: !ruby/object:Gem::Requirement
@@ -57,6 +73,8 @@ files:
57
73
  - Rakefile
58
74
  - hyperscore.gemspec
59
75
  - lib/hyperscore.rb
76
+ - lib/hyperscore/client.rb
77
+ - lib/hyperscore/coercions.rb
60
78
  - lib/hyperscore/version.rb
61
79
  homepage: ''
62
80
  licenses: []
@@ -84,4 +102,3 @@ specification_version: 3
84
102
  summary: Easily navigate Cyberscore's Hypermedia API with the help of this little
85
103
  library
86
104
  test_files: []
87
- has_rdoc: