YPBT 0.1.4 → 0.1.5

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/spec/spec_helper.rb CHANGED
@@ -12,6 +12,8 @@ require './lib/YPBT/video.rb'
12
12
  require './lib/YPBT/author.rb'
13
13
  require './lib/YPBT/youtube_api.rb'
14
14
 
15
+ require_relative '../lib/YPBT'
16
+
15
17
  FIXTURES_FOLDER = 'spec/fixtures'
16
18
  CASSETTES_FOLDER = "#{FIXTURES_FOLDER}/cassettes"
17
19
  CASSETTE_FILE = 'youtube_api'
@@ -22,4 +24,5 @@ YT_RESULT = YAML.load(File.read(RESULT_FILE))
22
24
  unless ENV.key? 'YOUTUBE_API_KEY'
23
25
  CREDENTIALS = YAML.load(File.read('config/credentials.yml'))
24
26
  ENV['YOUTUBE_API_KEY'] = CREDENTIALS[:YOUTUBE_API_KEY]
27
+ ENV['YT_VIDEO_ID'] = CREDENTIALS[:YT_VIDEO_ID]
25
28
  end
data/spec/video_spec.rb CHANGED
@@ -14,9 +14,6 @@ describe 'Video specifications' do
14
14
 
15
15
  before do
16
16
  VCR.insert_cassette CASSETTE_FILE, record: :new_episodes
17
- # @youtube_api = YoutubeVideo::YtApi.new(
18
- # api_key: ENV['YOUTUBE_API_KEY']
19
- # )
20
17
  end
21
18
 
22
19
  after do
@@ -27,6 +24,9 @@ describe 'Video specifications' do
27
24
  it 'should be able to get a new api key with ENV credentials' do
28
25
  YoutubeVideo::YtApi.api_key.length.must_be :>, 0
29
26
  end
27
+ it 'should be able to get a new access token with file credentials' do
28
+ YoutubeVideo::YtApi.config = { api_key: ENV['YOUTUBE_API_KEY'] }
29
+ end
30
30
  end
31
31
 
32
32
  it 'should be able to open a video' do
@@ -70,4 +70,9 @@ describe 'Video specifications' do
70
70
  # retrieved.author.author_image_url.must_equal comment['snippet']['authorProfileImageUrl']
71
71
  # retrieved.author.author_channel_url.must_equal comment['snippet']['authorChannelUrl']
72
72
  end
73
+
74
+ it 'should run the executable file' do
75
+ output = `YPBT #{TEST_VIDEO_ID}`
76
+ output.split("\n").length.must_be :>, 5
77
+ end
73
78
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: YPBT
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yi-Min
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2016-10-28 00:00:00.000000000 Z
13
+ date: 2016-11-03 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: http
@@ -152,7 +152,7 @@ dependencies:
152
152
  - - "~>"
153
153
  - !ruby/object:Gem::Version
154
154
  version: '0.42'
155
- description: Youtube Progress Bar Tagger extracts comment threads, comments, and comment
155
+ description: Youtube Progress Bar Taggerextracts comment threads, comments, and comment
156
156
  of author from Youtube videos
157
157
  email:
158
158
  - - b37582000@gmail.com
@@ -165,6 +165,7 @@ extra_rdoc_files: []
165
165
  files:
166
166
  - ".gitignore"
167
167
  - ".rubocop.yml"
168
+ - ".travis.yml"
168
169
  - Gemfile
169
170
  - LICENSE
170
171
  - README.md
@@ -175,6 +176,7 @@ files:
175
176
  - lib/YPBT.rb
176
177
  - lib/YPBT/author.rb
177
178
  - lib/YPBT/comment.rb
179
+ - lib/YPBT/runner.rb
178
180
  - lib/YPBT/version.rb
179
181
  - lib/YPBT/video.rb
180
182
  - lib/YPBT/youtube_api.rb