yetty 0.1.0 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7f45bd672b89d1030a4d3dc6c661c9509feb07d0
4
- data.tar.gz: 8e357c6886ad138f1c56cd727ac340d62fcad281
3
+ metadata.gz: 33e9ad7c97659b85bbfbd10bd7f7a1e2fedd8950
4
+ data.tar.gz: 3197ddd3065ebd4ae72f4a8cb2873db197e97620
5
5
  SHA512:
6
- metadata.gz: a98db022addf0ad2ff0ad3fc2864454e9ad365b666620331cd73b665b23358a8aad67855a907fe2c132434392f1992540d0a1a1511fee92158cd3a1ab9cc97b6
7
- data.tar.gz: 21bad94340f8d3769204c587cdc4f0678aac9c87160f1b6aed8af17d7cbc24784fcd9f755dc8d6be4b2c9bea6caba2f5605d1ac0d889171112f86266c829bae8
6
+ metadata.gz: 2f433cb7a4ef52eb74f717e649819c3bf34d2ec5920ca4f182730b63cd35acefadbf4074f46f963ec2250f3c104d053af72fdcf9fb79e38f9164c838262df60a
7
+ data.tar.gz: 072f2017f1dd174f28aa3e672926dd8a40bd10e95b5b568b154d4bbe4767bd161a83451470f649f054e4c2e6221ef441be8e7ae7406001daa50a21da787d428c
data/CHANGELOG.md CHANGED
@@ -1,2 +1,6 @@
1
+ ## v0.1.2
2
+ * Add updates for to supported embedded iframe
3
+ * Allow site API configuration to be driven via config
4
+
1
5
  ## v0.1.0
2
6
  * Initial release
@@ -1,4 +1,5 @@
1
1
  require 'base64'
2
+ require 'bogo'
2
3
  require 'sinatra/base'
3
4
 
4
5
  module Yetty
@@ -6,18 +7,30 @@ module Yetty
6
7
  # Web UI
7
8
  class App < Sinatra::Base
8
9
 
10
+ include Bogo::Memoization
11
+
12
+ set :protection, :except => :frame_options
13
+
14
+ def config
15
+ memoize(:config, :direct) do
16
+ path = ENV['YETTY_SITE_CONFIG']
17
+ unless(path)
18
+ path = Command::DEFAULT_CONFIGURATION_FILES.detect do |check|
19
+ full_check = File.expand_path(check)
20
+ File.exists?(full_check)
21
+ end
22
+ end
23
+ MultiJson.load(File.read(path)).to_smash
24
+ end
25
+ end
26
+
9
27
  def bucket
10
28
  storage = Miasma.api(
11
29
  :type => :storage,
12
- :provider => :aws,
13
- :credentials => {
14
- :aws_access_key_id => ENV['MIASMA_AWS_ACCESS_KEY_ID'],
15
- :aws_secret_access_key => ENV['MIASMA_AWS_SECRET_ACCESS_KEY'],
16
- :aws_region => ENV['MIASMA_AWS_REGION'],
17
- :aws_bucket_region => 'us-west-2'
18
- }
30
+ :provider => config.get(:site, :storage, :provider),
31
+ :credentials => config.get(:site, :storage, :credentials)
19
32
  )
20
- bucket = storage.buckets.get('cr-test-00')
33
+ storage.buckets.get(config.get(:site, :storage, :bucket))
21
34
  end
22
35
 
23
36
  set :public_folder, File.join(File.dirname(__FILE__), 'static')
@@ -45,6 +58,22 @@ module Yetty
45
58
  )
46
59
  end
47
60
 
61
+ get '/embed/:info' do
62
+ rec_path = Base64.urlsafe_decode64(params[:info])
63
+ user, state, name = rec_path.split('/')
64
+ rec_url = bucket.files.get(rec_path).url
65
+ haml(
66
+ :embed,
67
+ :layout => :embed_layout,
68
+ :locals => {
69
+ :user => user,
70
+ :state => state,
71
+ :name => name,
72
+ :url => rec_url
73
+ }
74
+ )
75
+ end
76
+
48
77
  get '/users' do
49
78
  file = bucket.files.get('userlist.json')
50
79
  users = file ? MultiJson.load(file.body.readpartial).to_smash[:users] : []
@@ -0,0 +1,20 @@
1
+ #player
2
+ .header= name
3
+ #term
4
+ .progress
5
+ .progress-bar.progress-info.progress-striped.bar
6
+ %nav.controls
7
+ %li.sc-button.action-toggle{'data-action' => 'play'}
8
+ %span.glyphicon.glyphicon-play
9
+ %li.speed-container
10
+ %input.speed{type: 'text', value: '2.5'}
11
+ %input.cmdline{:hidden => 'hidden'}
12
+
13
+ :javascript
14
+ jQuery(function(){
15
+ window.term = new Terminal(80, 24);
16
+ window.term.id = 1;
17
+ term.open(document.getElementById('term'));
18
+ window.player = new VT.Player(term);
19
+ window.player.load('#{url}');
20
+ });
@@ -0,0 +1,14 @@
1
+ !!! 5
2
+ %html
3
+ %head
4
+ %title= "Yetty - [#{@title || '-'}]"
5
+ %link{:type => 'text/css', :rel => 'stylesheet', :href => '/css/styles.css'}
6
+ %link{:type => 'text/css', :rel => 'stylesheet', :href => '/css/player.css'}
7
+ %link{:type => 'text/css', :rel => 'stylesheet', :href => '/css/fd-slider.css'}
8
+ %script{:type => 'text/javascript', :src => '/js/jquery-2.1.1.min.js'}
9
+ %script{:type => 'text/javascript', :src => '/js/bootstrap.min.js'}
10
+ %script{:type => 'text/javascript', :src => '/js/player/fd-slider.min.js'}
11
+ %script{:type => 'text/javascript', :src => '/js/player/term.js'}
12
+ %script{:type => 'text/javascript', :src => '/js/player/player.js'}
13
+ %body.embed{:style => 'background-image: none; background-color: white;'}
14
+ = yield
data/lib/yetty/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Yetty
2
2
  # Library version
3
- VERSION = Gem::Version.new('0.1.0')
3
+ VERSION = Gem::Version.new('0.1.2')
4
4
  end
data/yetty.gemspec CHANGED
@@ -13,9 +13,12 @@ Gem::Specification.new do |s|
13
13
  s.add_dependency 'miasma'
14
14
  s.add_dependency 'sinatra'
15
15
  s.add_dependency 'haml'
16
- s.add_dependency 'slop'
16
+ s.add_dependency 'slop', '~> 3.0'
17
17
  s.add_dependency 'paint'
18
18
  s.add_dependency 'shelr'
19
+ s.add_dependency 'compass'
20
+ s.add_dependency 'bootstrap-sass'
21
+ s.add_dependency 'bogo'
19
22
  s.executables << 'yetty'
20
23
  s.files = Dir['{lib,bin}/**/**/*'] + %w(yetty.gemspec README.md CHANGELOG.md LICENSE)
21
24
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yetty
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Roberts
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-11 00:00:00.000000000 Z
11
+ date: 2015-01-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: miasma
@@ -54,6 +54,20 @@ dependencies:
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: slop
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '3.0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '3.0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: paint
57
71
  requirement: !ruby/object:Gem::Requirement
58
72
  requirements:
59
73
  - - ">="
@@ -67,7 +81,7 @@ dependencies:
67
81
  - !ruby/object:Gem::Version
68
82
  version: '0'
69
83
  - !ruby/object:Gem::Dependency
70
- name: paint
84
+ name: shelr
71
85
  requirement: !ruby/object:Gem::Requirement
72
86
  requirements:
73
87
  - - ">="
@@ -81,7 +95,35 @@ dependencies:
81
95
  - !ruby/object:Gem::Version
82
96
  version: '0'
83
97
  - !ruby/object:Gem::Dependency
84
- name: shelr
98
+ name: compass
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :runtime
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: bootstrap-sass
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :runtime
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: bogo
85
127
  requirement: !ruby/object:Gem::Requirement
86
128
  requirements:
87
129
  - - ">="
@@ -140,6 +182,8 @@ files:
140
182
  - lib/yetty/site/static/sounds/nyanlooped.mp3
141
183
  - lib/yetty/site/static/sounds/nyanslow.mp3
142
184
  - lib/yetty/site/views/about.haml
185
+ - lib/yetty/site/views/embed.haml
186
+ - lib/yetty/site/views/embed_layout.haml
143
187
  - lib/yetty/site/views/index.haml
144
188
  - lib/yetty/site/views/layout.haml
145
189
  - lib/yetty/site/views/recording.haml