yourub 2.0.0 → 2.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3dd41972b4391d0680edfb6a53c4ffac3251ec10
4
- data.tar.gz: 56d7304673339a8ee102c0ac93e5736f877453f4
3
+ metadata.gz: 64d97865517be78962f3b8e9222f3c5d0db480ff
4
+ data.tar.gz: eca3604b94f9893d6c0334d8c149cf27d82a7355
5
5
  SHA512:
6
- metadata.gz: 197357a9f8930cf34a8230c871d7315df3361b3db59f6c42df6ace9e5308770fd9cff323b961fd02d4936006d6dd9e7edbeeb3fe7bc1f3d8636350538c909e35
7
- data.tar.gz: e69618e8f18d5aa6eb9d8a76bf0f949cac2ed1effcd57ccce6a837917e1628d8966338c41bc7c7391b6bb9b3f825e99d8026d02b10cf9871b49bca9402376736
6
+ metadata.gz: c6180c0872f7939e9286642079f8fc93a60fef7adb49ab0cef5e2380db5245652fee3a2ce85a662ae7c83664ecf433fcf583502dbfeb2869941a810327c20ed1
7
+ data.tar.gz: 3366a1e4ed5d8b78a099fbdef5da5b38f2a9f8e4e7cb21cf51f3aadd829daf09b79d38bbf3b296fa38ce86ee17d55ad6492c2387c82a882a7abcaf31d83e6b0d
data/.travis.yml ADDED
@@ -0,0 +1,19 @@
1
+ language: ruby
2
+
3
+ rvm:
4
+ - 1.9.3
5
+ - 2.0.0
6
+ - 2.1
7
+ - 2.2
8
+ - jruby-19mode
9
+ - jruby-head
10
+ - rbx-2
11
+ - ruby-head
12
+
13
+ sudo: false
14
+
15
+ bundler_args: --without development --retry=3 --jobs=3
16
+
17
+ env:
18
+ global:
19
+ - JRUBY_OPTS="$JRUBY_OPTS --debug"
data/README.md CHANGED
@@ -1,3 +1,6 @@
1
+ [![Gem Version](https://badge.fury.io/rb/yourub.svg)](http://badge.fury.io/rb/yourub)
2
+ [![Dependency Status](https://gemnasium.com/edap/yourub.svg)](https://gemnasium.com/edap/yourub)
3
+ [![Build Status](https://travis-ci.org/edap/yourub.svg?branch=master)](https://travis-ci.org/edap/yourub)
1
4
  [![Code Climate](https://codeclimate.com/github/edap/yourub.png)](https://codeclimate.com/github/edap/yourub)
2
5
 
3
6
  # Yourub
@@ -42,7 +45,7 @@ test:
42
45
  ```
43
46
 
44
47
  If you want to use it from the console, or in another program, you can simply
45
- pass an hash containing the needed option
48
+ pass an hash containing the needed options
46
49
  ```ruby
47
50
  options = { developer_key: 'mySecretKey',
48
51
  application_name: 'yourub',
@@ -78,8 +81,6 @@ that is the content of the response:
78
81
  ### Available parameters
79
82
  `:query` String, example `aliens`
80
83
 
81
- `:id` Sting, a valid youtube video id, example `NisCkxU544c`. If this parameter is set, tha others are ignored
82
-
83
84
  `:country` String, one or more alpha-2 country codes [ISO 3166-1](http://www.iso.org/iso/country_codes/iso_3166_code_lists/country_names_and_code_elements.htm), example `US` or `IT, DE`. The default one is `US`
84
85
 
85
86
  `:category` String, example `comedy`. It accept the wildcard `all`, that retrieves videos for all the category for the given nation, or the default one (US) if no one is given
@@ -90,32 +91,47 @@ that is the content of the response:
90
91
 
91
92
  `:order` String, one of these: 'date', 'rating', 'relevance', 'title', 'videocount', 'viewcount'. The default one is `'relevance'`
92
93
 
93
- It's necessary at least one of this parameters to start a search: `:country`, `:category`, `:query`, `:id`
94
+ It's necessary at least one of this parameters to start a search: `:country`, `:category`, `:query`
94
95
 
95
96
  ### Methods
96
- `search`, search youtube videos for the given parameters
97
+ * `search`, search youtube videos for the given parameters
97
98
  ```ruby
98
99
  client = Yourub::Client.new
99
- client.search(id: "NisCkxU544c")
100
+ client.search(query: "space missions")
100
101
  ```
101
102
 
102
- `get_views`
103
- retrieves the number of views for the given videos id
103
+ * `get_views`
104
+ it return the number of views for the given video id
104
105
  ```ruby
105
106
  client = Yourub::Client.new
106
107
  client.get_views("G2b0OIkTraI")
107
108
  ```
109
+ * `get_video`
110
+ retrieves all the metatags available for one
111
+ ```ruby
112
+ client = Yourub::Client.new
113
+ client.get_video("G2b0OIkTraI")
114
+ ```
108
115
 
116
+ ## Supported Ruby Versions
117
+ This gem [supports](https://travis-ci.org/edap/yourub) the following Ruby versions:
109
118
 
119
+ * Ruby 1.9.3
120
+ * Ruby 2.0.0
121
+ * Ruby 2.1
122
+ * Ruby 2.2
123
+ * JRuby 1.7 (in Ruby 1.9 mode)
110
124
 
111
125
  ##TODO
112
- * the result should be yield, and not saved in an instance variable
113
- * Implementing playlist
114
-
126
+ Here there is a [list](https://developers.google.com/youtube/v3/docs/) of the available methods.
127
+ Currently, this gem implements: [videos.list](https://developers.google.com/youtube/v3/docs/videos/list), [search.list](https://developers.google.com/youtube/v3/docs/search/list) and [videoCategories.list](https://developers.google.com/youtube/v3/docs/videoCategories/list).
128
+ The next methods that will be implemented are [playlist.list](https://developers.google.com/youtube/v3/docs/playlists/list) and [channelis.list](https://developers.google.com/youtube/v3/docs/channels/list)
115
129
  ## Contributing
116
130
 
117
131
  1. Fork it
118
132
  2. Create your feature branch (`git checkout -b my-new-feature`)
119
133
  3. Commit your changes (`git commit -am 'Add some feature'`)
120
- 4. Push to the branch (`git push origin my-new-feature`)
121
- 5. Create new Pull Request
134
+ 4. Run the test, run the spec/yourub/integration.rb file with a valid developer
135
+ key
136
+ 5. Push to the branch (`git push origin my-new-feature`)
137
+ 4. Create new Pull Request
data/lib/yourub/config.rb CHANGED
@@ -22,7 +22,6 @@ module Yourub
22
22
  @config = OpenStruct.new YAML.load_file(file_path)[environment]
23
23
  end
24
24
 
25
-
26
25
  def override_config_file(hash)
27
26
  opt = valid_options(hash)
28
27
  @config = OpenStruct.new opt
@@ -1,6 +1,2 @@
1
- Yourub::Config.load!(File.join("config", "yourub.yml"), 'yourub_defaults')
2
-
3
1
  logger = Logger.new(STDOUT)
4
- logger.level = Logger.const_get(Yourub::Config.log_level.upcase)
5
-
6
2
  Yourub.logger = logger
@@ -3,7 +3,7 @@ module Yourub
3
3
  class Request
4
4
  attr_reader :data, :status
5
5
  #
6
- # Once initializated, the Request object forward a request to
6
+ # Once initializated, the Request object forward a request to
7
7
  # youtube api, once the request is completed, the variables @status and @data are populated
8
8
  #
9
9
  # @param client [Yourub::Client]
@@ -16,7 +16,7 @@ module Yourub
16
16
  # Yourub::REST::Request.new(client,"video_categories", "list", param)
17
17
  #
18
18
  def initialize(client, resource_type, method, params)
19
- @client = client
19
+ @client = client
20
20
  @resource_type = resource_type.to_sym
21
21
  @method = method.to_sym
22
22
  @params = params
@@ -33,12 +33,11 @@ private
33
33
  # @data [String]
34
34
  #
35
35
  def perform
36
- api_method =@client.youtube_api.send(@resource_type).send(@method)
36
+ api_method =@client.youtube_api.send(@resource_type).send(@method)
37
37
  r = @client.execute!(
38
38
  :api_method => api_method,
39
39
  :parameters => @params
40
- )
41
- #byebug
40
+ )
42
41
  @data = r.data
43
42
  @status = r.status
44
43
  end
@@ -1,6 +1,6 @@
1
1
  module Yourub
2
2
  MAJOR = 2
3
3
  MINOR = 0
4
- PATCH = 0
4
+ PATCH = 2
5
5
  VERSION = [MAJOR, MINOR, PATCH].compact.join('.')
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yourub
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Davide Prati
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-15 00:00:00.000000000 Z
11
+ date: 2015-02-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google-api-client
@@ -47,6 +47,7 @@ extensions: []
47
47
  extra_rdoc_files: []
48
48
  files:
49
49
  - ".gitignore"
50
+ - ".travis.yml"
50
51
  - Gemfile
51
52
  - LICENSE.txt
52
53
  - README.md
@@ -90,7 +91,6 @@ files:
90
91
  - spec/yourub/rest/videos_spec.rb
91
92
  - spec/yourub/validator_spec.rb
92
93
  - yourub.gemspec
93
- - yourub.sublime-project
94
94
  homepage: https://github.com/edap/yourub
95
95
  licenses:
96
96
  - MIT
@@ -1,8 +0,0 @@
1
- {
2
- "folders":
3
- [
4
- {
5
- "path": "lib/yourub"
6
- }
7
- ]
8
- }