itunes-client 0.1.0 → 0.1.1

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: 84cff6353f729ae6ed533ee0ea61f5ef4bc054f0
4
- data.tar.gz: 69f8934039019946f497a38aaca502590948261c
3
+ metadata.gz: 8f1c91e02d16364127d719091b1ed109ae00d905
4
+ data.tar.gz: f063ff6d206acc2795795c7f30cf768d16c39d94
5
5
  SHA512:
6
- metadata.gz: b65f4e065e816a8d61d8c04266d11a56e60cd60fd59c967648b1adb2ec335e53ffc4dc5a873a7aa1338b36b5f15489545ec146f8a1ddd5c5f0411805311aef0e
7
- data.tar.gz: a4ef2807ecfca46366828afc7e2edf0551a178c9a73d9145ac7ff8ee1aee1f70669813adce4da7c12a12901a6a3eeed1c86c23caa320081a62c6c90a32dfc835
6
+ metadata.gz: b614bc34af5c7adca7cd1e7afd6d2d836c85260a825d287bfe410e109ffb70714ba91f68c20947f204b318ab40e1fc7bdb2e0f6b9dd1a0c02dfe0d4d44eeeb89
7
+ data.tar.gz: 0d255ef6391c425c76e1aa3d168ec677896affffb4e9f7b1261f386a41f05cb03cffc3bcd3ab344bafd23dab639356293802ad06eebeca6a0284651235e89f7f
data/README.md CHANGED
@@ -38,8 +38,7 @@ require 'itunes-client'
38
38
  include Itunes
39
39
 
40
40
  # Add a track to player
41
- application = Application.instance
42
- track = application.add(path_to_your_sound_file)
41
+ track = Itunes::Player.add(path_to_your_sound_file)
43
42
 
44
43
  # Convert by default encoder
45
44
  encoded_track = track.convert
data/lib/itunes/player.rb CHANGED
@@ -14,6 +14,11 @@ module Itunes
14
14
  Track.find_by(persistent_id: persistent_id).first
15
15
  end
16
16
 
17
+ def play
18
+ execute_script("#{script_dir}/play.scpt")
19
+ self
20
+ end
21
+
17
22
  def stop
18
23
  execute_script("#{script_dir}/stop.scpt")
19
24
  self
@@ -1,3 +1,3 @@
1
1
  module Itunes
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -0,0 +1,3 @@
1
+ tell application "iTunes"
2
+ play
3
+ end tell
@@ -41,6 +41,13 @@ describe Player do
41
41
  end
42
42
  end
43
43
 
44
+ describe '.play' do
45
+ it 'calls play.scpt' do
46
+ player.should_receive(:execute_script).with('player/play.scpt')
47
+ player.play
48
+ end
49
+ end
50
+
44
51
  describe '.playing?' do
45
52
  subject { player.playing? }
46
53
  context 'when iTunes plays a track' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: itunes-client
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
  - ryo katsuma
@@ -177,6 +177,7 @@ files:
177
177
  - scripts/player/add.scpt
178
178
  - scripts/player/next_track.scpt
179
179
  - scripts/player/pause.scpt
180
+ - scripts/player/play.scpt
180
181
  - scripts/player/player_state.scpt
181
182
  - scripts/player/prev_track.scpt
182
183
  - scripts/player/stop.scpt