rocketwheel-command 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -48,6 +48,7 @@ rocket build
48
48
 
49
49
  * `player_options`: A hash of player options.
50
50
  * `playlist`: An array of hashes, representing the playlist.
51
+ * `manifest`: The parsed Rocketfile.yml
51
52
 
52
53
  **Encode**
53
54
 
@@ -1,5 +1,6 @@
1
1
  require 'fog'
2
2
  require 'transloadit'
3
+ require 'json'
3
4
 
4
5
  require 'rocketwheel/command/version'
5
6
  require 'rocketwheel/command/manifest'
@@ -19,6 +19,7 @@ module Rocketwheel::Command::CLI
19
19
  :default => 'build'
20
20
  def build
21
21
  directory source, destination
22
+ say_status :downloading, 'demoplayer'
22
23
  player.download_and_unzip(File.join(destination, 'demoplayer'))
23
24
  rescue Rocketwheel::Command::PlayerNotFound => e
24
25
  raise Thor::Error, "#{e.message} Run `rocket versions` to see a full list of available players."
@@ -14,7 +14,17 @@ module Rocketwheel::Command::CLI
14
14
  method_option :version,
15
15
  :desc => 'The player version to use. Defaults to latest.'
16
16
  def new(name)
17
- directory version, name
17
+ dir = version.dup
18
+ until File.exists?(File.join(self.class.source_root, dir)) do
19
+ raise Thor::Error, "No project template for version #{version}" unless dir.gsub! /(.*)\..*/, '\\1'
20
+ end
21
+ directory dir, name
22
+ end
23
+
24
+ no_tasks do
25
+ def version
26
+ options[:version] || Rocketwheel::Command::Player.latest_version
27
+ end
18
28
  end
19
29
 
20
30
  class NoTemplateDirectory < Directory
@@ -36,6 +46,10 @@ module Rocketwheel::Command::CLI
36
46
  dirname = File.dirname(file_destination).gsub(/\/\.$/, '')
37
47
  next if dirname == given_destination
38
48
  base.empty_directory(dirname, config)
49
+ when /\.ignore$/
50
+ destination = base.copy_file(file_source, file_destination[0..-8], config, &@block)
51
+ when /\.tt$/
52
+ destination = base.template(file_source, file_destination[0..-4], config, &@block)
39
53
  else
40
54
  destination = base.copy_file(file_source, file_destination, config, &@block)
41
55
  end
@@ -51,9 +65,5 @@ module Rocketwheel::Command::CLI
51
65
  action NoTemplateDirectory.new(self, source, destination || source, config, &block)
52
66
  end
53
67
 
54
- def version
55
- options[:version] || Rocketwheel::Command::Player.latest_version
56
- end
57
-
58
68
  end
59
69
  end
@@ -1,43 +1,38 @@
1
+ require 'thor/core_ext/hash_with_indifferent_access'
1
2
  require 'yaml'
2
3
 
3
4
  module Rocketwheel
4
5
  module Command
5
- class Manifest
6
+ class Manifest < Thor::CoreExt::HashWithIndifferentAccess
6
7
  S3Config = Struct.new(:key, :secret, :bucket, :path)
7
8
  TransloaditConfig = Struct.new(:key, :secret, :steps)
8
9
 
9
- attr_accessor :content
10
-
11
10
  def self.from_file(path)
12
11
  new(YAML.load(File.open(path)))
13
12
  end
14
13
 
15
- def initialize(hash)
16
- @content = hash
17
- end
18
-
19
14
  def version
20
- @version ||= content.fetch('version', Player.latest_version)
15
+ @version ||= self.fetch('version', Player.latest_version)
21
16
  end
22
17
 
23
18
  def s3
24
19
  @s3 ||= begin
25
- config = content.fetch('s3', Hash.new)
20
+ config = self.fetch('s3', Hash.new)
26
21
  S3Config.new(config['key'], config['secret'], config['bucket'], config['path'].to_s)
27
22
  end
28
23
  end
29
24
 
30
25
  def playlist
31
- @playlist = content.fetch('playlist', [])
26
+ @playlist = self.fetch('playlist', [])
32
27
  end
33
28
 
34
29
  def player_options
35
- @player_options ||= content.fetch('player', Hash.new)
30
+ @player_options ||= self.fetch('player', Hash.new)
36
31
  end
37
32
 
38
33
  def transloadit
39
34
  @transloadit ||= begin
40
- config = content.fetch('transloadit', Hash.new)
35
+ config = self.fetch('transloadit', Hash.new)
41
36
  TransloaditConfig.new(config['key'], config['secret'], config['steps'])
42
37
  end
43
38
  end
@@ -1,5 +1,5 @@
1
1
  module Rocketwheel
2
2
  module Command
3
- VERSION = '1.0.1'
3
+ VERSION = '1.0.2'
4
4
  end
5
5
  end
@@ -23,6 +23,7 @@ Gem::Specification.new do |gem|
23
23
  gem.add_dependency 'fog', '~> 1.9.0'
24
24
  gem.add_dependency 'rubyzip', '~> 0.9.9'
25
25
  gem.add_dependency 'mime-types', '~> 1.21'
26
+ gem.add_dependency 'json', '~> 1.7.7'
26
27
 
27
28
  gem.add_development_dependency 'rake'
28
29
  gem.add_development_dependency 'rspec'
@@ -1,4 +1,4 @@
1
- version: 2.1.2
1
+ version: <%= version %>
2
2
 
3
3
  # s3:
4
4
  # key: s3key
@@ -0,0 +1,27 @@
1
+ <!DOCTYPE HTML>
2
+ <html>
3
+ <head>
4
+ <title>Title</title>
5
+ <link rel="stylesheet" href="demoplayer/stylesheets/player.css" type="text/css" media="screen">
6
+ <script src="demoplayer/javascripts/player.js" type="text/javascript"></script>
7
+ <meta name="viewport" content="width=880" />
8
+ <script type="text/javascript">
9
+ $(function() {
10
+ Player.setup({
11
+ playlist: <%= JSON.pretty_generate(playlist) %>,
12
+ jwplayer_options: <%= JSON.pretty_generate(player_options) %>
13
+ })
14
+ })
15
+ </script>
16
+ </head>
17
+ <body>
18
+ <div id="demoplayer-position">
19
+ <script type="text/x-handlebars">
20
+ {{#view Player.View styles="inline"}}
21
+ {{view Player.PlayerView}}
22
+ {{view Player.PlaylistView}}
23
+ {{/view}}
24
+ </script>
25
+ </div>
26
+ </body>
27
+ </html>
@@ -1,4 +1,10 @@
1
- version: 3.0.0.beta1
1
+ version: <%= version %>
2
+
3
+ # Google Analytics
4
+ ua: UA-XXXXXX
5
+
6
+ # Share This
7
+ stpublisher: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
2
8
 
3
9
  # s3:
4
10
  # key: s3key
@@ -18,6 +24,8 @@ player:
18
24
  width: 854
19
25
  height: 480
20
26
  # autostart: false
27
+ # analytics:
28
+ # category: Foobar
21
29
 
22
30
  # transloadit:
23
31
  # key: transloadit key
@@ -0,0 +1,60 @@
1
+ <!DOCTYPE HTML>
2
+ <html>
3
+ <head>
4
+ <title>Title</title>
5
+ <meta http-equiv="X-UA-Compatible" content="IE=edge" >
6
+ <meta name="viewport" content="width=880" />
7
+ <link rel="stylesheet" href="demoplayer/stylesheets/player.css" type="text/css" media="screen">
8
+ <script src="demoplayer/javascripts/jwplayer.js" type="text/javascript"></script>
9
+ <script src="demoplayer/javascripts/player.js" type="text/javascript"></script>
10
+ <script type="text/javascript">
11
+ var _gaq = _gaq || [];
12
+ _gaq.push(['_setAccount', '<%= manifest[:ua] %>']);
13
+ _gaq.push(['_trackPageview']);
14
+
15
+ (function() {
16
+ var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
17
+ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
18
+ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
19
+ })();
20
+ </script>
21
+ <script type="text/javascript">var switchTo5x=true;</script>
22
+ <script type="text/javascript" src="http://w.sharethis.com/button/buttons.js"></script>
23
+ <script type="text/javascript">stLight.options({publisher:'<%= manifest[:stpublisher] %>'})</script>
24
+ <script type="text/javascript">
25
+ $(function() {
26
+ window.player = new Player(<%= JSON.pretty_generate(player_options.merge('playlist' => playlist)) %>)
27
+ })
28
+ </script>
29
+ </head>
30
+ <body>
31
+ <div id="player">
32
+ <div id="backend"></div>
33
+ <div id="playlist" data-slides="4"></div>
34
+ <div class="branding">
35
+ <img class="logo" src="">
36
+ <div class="share">
37
+ <span class='st_twitter'></span>
38
+ <span class='st_facebook'></span>
39
+ <span class='st_email'></span>
40
+ <span class='st_sharethis'></span>
41
+ </div>
42
+ <div class="player-cta">
43
+ <a href="http://www.google.com" class="track-link" data-track-action="Player CTA - Request Quote">Request a Quote</a>
44
+ <a href="http://www.google.com" class="track-link" data-track-action="Player CTA - Request Quote">Learn More</a>
45
+ </div>
46
+ </div>
47
+ <div id="annotations">
48
+ <div class="annotation" data-index="0" data-start="0" data-stop="5" data-image="foobar.png">
49
+ Hello World <a href="#" class="replay">Replay</a>
50
+ </div>
51
+ <div class="annotation" data-index="1" data-start="5" data-pause="true">
52
+ Continue! <a href="#" class="play">Click Me to Continue</a>
53
+ </div>
54
+ <div class="annotation" data-index="4" data-start="61" >
55
+ This will show up at 61 secs of the last video, and will remain visible.
56
+ </div>
57
+ </div>
58
+ </div>
59
+ </body>
60
+ </html>
@@ -0,0 +1,9 @@
1
+ ## Templates
2
+
3
+ This directory holds project templates for the different versions of the
4
+ player.
5
+
6
+ The template is fuzzy matched to the version number of the player.
7
+ For example, if the user runs `rocket new foo --version=3.0.0.beta1`, it will
8
+ first look for a directory named **3.0.0.beta1**, if that directory
9
+ isn't found, it will look for **3.0.0**, then **3.0**, until a match is found.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rocketwheel-command
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.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: 2013-03-14 00:00:00.000000000 Z
12
+ date: 2013-03-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: thor
@@ -91,6 +91,22 @@ dependencies:
91
91
  - - ~>
92
92
  - !ruby/object:Gem::Version
93
93
  version: '1.21'
94
+ - !ruby/object:Gem::Dependency
95
+ name: json
96
+ requirement: !ruby/object:Gem::Requirement
97
+ none: false
98
+ requirements:
99
+ - - ~>
100
+ - !ruby/object:Gem::Version
101
+ version: 1.7.7
102
+ type: :runtime
103
+ prerelease: false
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ~>
108
+ - !ruby/object:Gem::Version
109
+ version: 1.7.7
94
110
  - !ruby/object:Gem::Dependency
95
111
  name: rake
96
112
  requirement: !ruby/object:Gem::Requirement
@@ -151,14 +167,15 @@ files:
151
167
  - lib/rocketwheel/command/player.rb
152
168
  - lib/rocketwheel/command/version.rb
153
169
  - rocketwheel-command.gemspec
154
- - templates/project/2.1.2/Rocketfile.yml
155
- - templates/project/2.1.2/source/images/.empty_directory
156
- - templates/project/2.1.2/source/index.html.tt
157
- - templates/project/2.1.2/source/videos/.empty_directory
158
- - templates/project/3.0.0.beta1/Rocketfile.yml
159
- - templates/project/3.0.0.beta1/source/images/.empty_directory
160
- - templates/project/3.0.0.beta1/source/index.html.tt
161
- - templates/project/3.0.0.beta1/source/videos/.empty_directory
170
+ - templates/project/2.1/Rocketfile.yml.tt
171
+ - templates/project/2.1/source/images/.empty_directory
172
+ - templates/project/2.1/source/index.html.tt.ignore
173
+ - templates/project/2.1/source/videos/.empty_directory
174
+ - templates/project/3.0/Rocketfile.yml.tt
175
+ - templates/project/3.0/source/images/.empty_directory
176
+ - templates/project/3.0/source/index.html.tt.ignore
177
+ - templates/project/3.0/source/videos/.empty_directory
178
+ - templates/project/README.md
162
179
  - templates/transloadit.yml
163
180
  homepage: https://github.com/luminosity-group/rocketwheel-command
164
181
  licenses:
@@ -186,3 +203,4 @@ signing_key:
186
203
  specification_version: 3
187
204
  summary: Command line tool for encoding, building and deploying demo packages.
188
205
  test_files: []
206
+ has_rdoc:
@@ -1,27 +0,0 @@
1
- <!DOCTYPE HTML>
2
- <html>
3
- <head>
4
- <title>Title</title>
5
- <link rel="stylesheet" href="demoplayer/stylesheets/player.css" type="text/css" media="screen">
6
- <script src="demoplayer/javascripts/player.js" type="text/javascript"></script>
7
- <meta name="viewport" content="width=880" />
8
- <script type="text/javascript">
9
- $(function() {
10
- Player.setup({
11
- playlist: <%= playlist.to_json %>,
12
- jwplayer_options: <%= player_options.to_json %>
13
- })
14
- })
15
- </script>
16
- </head>
17
- <body>
18
- <div id="demoplayer-position">
19
- <script type="text/x-handlebars">
20
- {{#view Player.View styles="inline"}}
21
- {{view Player.PlayerView}}
22
- {{view Player.PlaylistView}}
23
- {{/view}}
24
- </script>
25
- </div>
26
- </body>
27
- </html>
@@ -1,21 +0,0 @@
1
- <!DOCTYPE HTML>
2
- <html>
3
- <head>
4
- <title>Title</title>
5
- <meta name="viewport" content="width=880" />
6
- <link rel="stylesheet" href="demoplayer/stylesheets/player.css" type="text/css" media="screen">
7
- <script src="demoplayer/javascripts/jwplayer.js" type="text/javascript"></script>
8
- <script src="demoplayer/javascripts/player.js" type="text/javascript"></script>
9
- <script type="text/javascript">
10
- $(function() {
11
- window.player = new Player(<%= player_options.merge('playlist' => playlist).to_json %>)
12
- })
13
- </script>
14
- </head>
15
- <body>
16
- <div id="player">
17
- <div id="backend"></div>
18
- <div id="playlist"></div>
19
- </div>
20
- </body>
21
- </html>