jpark 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +8 -0
- data/Gemfile +7 -0
- data/README.md +18 -0
- data/Rakefile +7 -0
- data/bin/jpark +9 -0
- data/jpark.gemspec +14 -0
- data/lib/jpark/client.rb +53 -0
- data/lib/jpark/dinosaur.rb +33 -0
- data/lib/jpark/version.rb +3 -0
- data/lib/jpark.rb +3 -0
- data/samples/jpark_theme.mp3 +0 -0
- data/spec/.gitkeep +0 -0
- metadata +58 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: ef1689b40724ddab781d5549ca4b1df21f663dfc
|
4
|
+
data.tar.gz: 2db377b50d92e3fcba942b484c795f17bf2f62f9
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 8d46811a0288fa3146b05f942ced8f14a2d122e696f871c99553627fcf08165a30a8fc8e7e4281c1fdafc572637fca62cfbb3601745ce37f5bb3e6e138acb1d9
|
7
|
+
data.tar.gz: 792147fa1866caacdf5672fca023455a16d5c2bcb2e629fa5b274b4b46a76e26f9e3d1b66ed858def2a7f0852192c5146019d887542fed5a3df38e25774422b6
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/README.md
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
# JPark -- Command Line Tool
|
2
|
+
|
3
|
+
You'll need some extra dependencies
|
4
|
+
|
5
|
+
if mac you can brew install these
|
6
|
+
brew install mpg123
|
7
|
+
brew install portaudio
|
8
|
+
|
9
|
+
if ubuntu its apt-get install
|
10
|
+
apt-get install libjack0 libjack-dev
|
11
|
+
apt-get install libportaudiocpp0 portaudio19-dev libmpg123-dev
|
12
|
+
|
13
|
+
Then run
|
14
|
+
|
15
|
+
``bundle install``
|
16
|
+
|
17
|
+
# Future Features
|
18
|
+
Animated dinosaur
|
data/Rakefile
ADDED
data/bin/jpark
ADDED
data/jpark.gemspec
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
Gem::Specification.new do |s|
|
2
|
+
s.name = 'jpark'
|
3
|
+
s.version = '0.0.1'
|
4
|
+
s.licenses = ['MIT']
|
5
|
+
s.summary = "Its the JPark Command line tool!"
|
6
|
+
s.description = "It is a helpful bunch of features for everyone!"
|
7
|
+
s.authors = ['Tom Cowling']
|
8
|
+
s.email = ['tom.cowling@gmail.com']
|
9
|
+
s.files = ['lib/jpark.rb']
|
10
|
+
s.files = `git ls-files`.split("\n")
|
11
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
12
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
13
|
+
s.require_paths = ["lib"]
|
14
|
+
end
|
data/lib/jpark/client.rb
ADDED
@@ -0,0 +1,53 @@
|
|
1
|
+
require 'thor'
|
2
|
+
require 'audite'
|
3
|
+
|
4
|
+
module JPark
|
5
|
+
class Client < Thor
|
6
|
+
def initialize(*args)
|
7
|
+
super(*args)
|
8
|
+
@dino = JPark::Dinosaur.new
|
9
|
+
@player = Audite.new
|
10
|
+
@player.events.on(:complete) do
|
11
|
+
puts "COMPLETE"
|
12
|
+
end
|
13
|
+
|
14
|
+
@player.events.on(:level) do |level|
|
15
|
+
puts "LEVEL: #{level}"
|
16
|
+
end
|
17
|
+
|
18
|
+
@player.events.on(:position_change) do |pos|
|
19
|
+
puts @dino.move
|
20
|
+
#system "clear" or system "cls"
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
desc 'version', 'Displays version number of JPark'
|
25
|
+
long_desc <<-LONGDESC
|
26
|
+
`jpark version` will print out a message containing the version number.
|
27
|
+
|
28
|
+
> $ jpark version\n
|
29
|
+
> 0.0.1
|
30
|
+
LONGDESC
|
31
|
+
def version
|
32
|
+
puts JPark::VERSION
|
33
|
+
end
|
34
|
+
|
35
|
+
desc 'success', 'Play success music'
|
36
|
+
long_desc <<-LONGDESC
|
37
|
+
`jpark success` will play the jurassic park music
|
38
|
+
`jpark success --repeatedly` will never stop playing the success music`
|
39
|
+
`jpark success -n 10` will play the music 10 times
|
40
|
+
|
41
|
+
> $ jpark success\n
|
42
|
+
> playing...
|
43
|
+
LONGDESC
|
44
|
+
def success
|
45
|
+
success_filename = File.dirname(__FILE__) + '/../../samples/jpark_theme.mp3'
|
46
|
+
puts success_filename
|
47
|
+
@player.load(success_filename)
|
48
|
+
@player.start_stream
|
49
|
+
sleep(100)
|
50
|
+
end
|
51
|
+
|
52
|
+
end
|
53
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
module JPark
|
2
|
+
class Dinosaur
|
3
|
+
def initialize
|
4
|
+
dino1 = [
|
5
|
+
" / _)",
|
6
|
+
" _.----._/ /",
|
7
|
+
" / /",
|
8
|
+
" __/ ( | ( |",
|
9
|
+
"/__.-'|_|--|_|",
|
10
|
+
].join("\n")
|
11
|
+
|
12
|
+
dino2 = [
|
13
|
+
" / _)",
|
14
|
+
" _.----._/ /",
|
15
|
+
" / /",
|
16
|
+
" __/ ( | ( |",
|
17
|
+
"/__.-'\\_\\--\\_\\ ",
|
18
|
+
].join("\n")
|
19
|
+
|
20
|
+
dino3 = [
|
21
|
+
" / _)",
|
22
|
+
" _.----._/ /",
|
23
|
+
" / /",
|
24
|
+
" __/ ( | ( |",
|
25
|
+
"/__.-/_/--/_/ ",
|
26
|
+
].join("\n")
|
27
|
+
@dinomation = [dino1, dino2, dino3].cycle
|
28
|
+
end
|
29
|
+
def move
|
30
|
+
puts @dinomation.next
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
data/lib/jpark.rb
ADDED
Binary file
|
data/spec/.gitkeep
ADDED
File without changes
|
metadata
ADDED
@@ -0,0 +1,58 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: jpark
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Tom Cowling
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-11-18 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: It is a helpful bunch of features for everyone!
|
14
|
+
email:
|
15
|
+
- tom.cowling@gmail.com
|
16
|
+
executables:
|
17
|
+
- jpark
|
18
|
+
extensions: []
|
19
|
+
extra_rdoc_files: []
|
20
|
+
files:
|
21
|
+
- ".gitignore"
|
22
|
+
- Gemfile
|
23
|
+
- README.md
|
24
|
+
- Rakefile
|
25
|
+
- bin/jpark
|
26
|
+
- jpark.gemspec
|
27
|
+
- lib/jpark.rb
|
28
|
+
- lib/jpark/client.rb
|
29
|
+
- lib/jpark/dinosaur.rb
|
30
|
+
- lib/jpark/version.rb
|
31
|
+
- samples/jpark_theme.mp3
|
32
|
+
- spec/.gitkeep
|
33
|
+
homepage:
|
34
|
+
licenses:
|
35
|
+
- MIT
|
36
|
+
metadata: {}
|
37
|
+
post_install_message:
|
38
|
+
rdoc_options: []
|
39
|
+
require_paths:
|
40
|
+
- lib
|
41
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
42
|
+
requirements:
|
43
|
+
- - ">="
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
46
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
47
|
+
requirements:
|
48
|
+
- - ">="
|
49
|
+
- !ruby/object:Gem::Version
|
50
|
+
version: '0'
|
51
|
+
requirements: []
|
52
|
+
rubyforge_project:
|
53
|
+
rubygems_version: 2.2.2
|
54
|
+
signing_key:
|
55
|
+
specification_version: 4
|
56
|
+
summary: Its the JPark Command line tool!
|
57
|
+
test_files:
|
58
|
+
- spec/.gitkeep
|