hyaslide 0.2.0 → 0.3.0

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: 8da32a463b9e78e260618047ce41e372051cba35
4
- data.tar.gz: e777a229d8ea06fd9c0244917b85f1fb76505b98
3
+ metadata.gz: f56b285a8341fe0b88ef1f5ce271b6ea9853a284
4
+ data.tar.gz: da9b87369da14fbd6d49e84fadd01615748f0453
5
5
  SHA512:
6
- metadata.gz: febb2b046ecd82944a9d17de00a6ba4404e44f813f52192300f730d3119a3ba9ba1b4aa637c733030ca922a49bef264b51d3d072311de1df5ba488be97f03776
7
- data.tar.gz: 9a0635689640c296a674deba02dd8f94777a98944627124b1539fe57ca8dd4568d9fd7384ff087fc9972279723afd342250c629290a501368de921d7fbee27e9
6
+ metadata.gz: 993f6c4905143ad13fa585ce28a4af2a176bd199fd367fd7ea19094646a086fa87cfef4b4654679fde3880f1047f9eb3dc7b6243a3f248b41b015505b9f0295c
7
+ data.tar.gz: c486eeb28d03b7fb1489302dafc4bc4039183227f508feab6654d5339271e9e6db147a4c966f74928aba564fa8c3861455d10e2cc8623874a7d2c3b400e72be6
data/bin/hyaslide CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require File.expand_path('../../lib/hyaslide', __FILE__)
3
+ require_relative '../lib/hyaslide/cli'
4
4
 
5
5
  Hyaslide::Cli.start(ARGV)
@@ -1,3 +1,3 @@
1
1
  module Hyaslide
2
- VERSION = "0.2.0"
2
+ VERSION = "0.3.0"
3
3
  end
data/lib/hyaslide.rb CHANGED
@@ -2,7 +2,6 @@ require "hyaslide/version"
2
2
 
3
3
  require 'hyaslide/cli'
4
4
  require "hyaslide/slide_loader"
5
- require "hyaslide/server"
6
5
 
7
6
  module Hyaslide
8
7
  end
@@ -145,7 +145,7 @@ module Hyaslide
145
145
  end
146
146
  end
147
147
 
148
- require 'pages'
148
+ require 'pages/pages'
149
149
 
150
150
  $document.ready do
151
151
  $window.on(:resize) do
File without changes
File without changes
@@ -1,29 +1,33 @@
1
1
  require 'bundler/setup'
2
2
  Bundler.require(:default)
3
3
 
4
- require 'opal'
5
- require 'opal-browser'
6
- require 'rack'
4
+ # require 'hyaslide'
5
+ require_relative 'server'
7
6
 
8
7
  dir = 'data'
9
8
  Dir.mkdir dir + '/pages' unless Dir.exist? dir + '/pages'
10
-
11
9
  Hyaslide::SlideLoader.new(dir).run
12
10
 
13
- server = Opal::Server.new do |s|
14
- s.append_path dir + '/pages'
15
- s.append_path 'app'
16
- s.append_path 'images'
17
- s.append_path 'css'
18
- s.append_path 'fonts'
11
+ app = Rack::Builder.app do
12
+ server = Server.new(host: 'localhost')
13
+
14
+ map '/' do
15
+ run server
16
+ end
19
17
 
20
- Opal.use_gem 'opal-router'
21
- Opal.use_gem 'hyalite'
22
- Opal.use_gem 'hyaslide'
18
+ map '/assets' do
19
+ run server.settings.opal.sprockets
20
+ end
23
21
 
24
- s.debug = true
25
- s.main = 'application'
26
- s.index_path = 'index.html.haml'
22
+ map '/__OPAL_SOURCE_MAPS__' do
23
+ run Opal::SourceMapServer.new(server.settings.opal.sprockets, '/__OPAL_SOURCE_MAPS__')
24
+ end
27
25
  end
28
26
 
29
- Rack::Handler::WEBrick.run server
27
+ Rack::Server.start({
28
+ app: app,
29
+ server: 'thin',
30
+ Host: '0.0.0.0',
31
+ Port: 8080,
32
+ signals: false,
33
+ })
@@ -0,0 +1,37 @@
1
+ class Hyaslide::Page0 < Hyaslide::PageBase
2
+ def header
3
+ h1(nil, "Title")
4
+ end
5
+
6
+ def content
7
+ [].tap do |children|
8
+ children << p({className:"author"}, "Your Name")
9
+ end
10
+ end
11
+ end
12
+
13
+ class Hyaslide::Page1 < Hyaslide::PageBase
14
+ def content
15
+ [].tap do |children|
16
+ children << h4(nil, "Press 's' then starting the race of rabbit and turtle.")
17
+ end
18
+ end
19
+ end
20
+
21
+ class Hyaslide::Page2 < Hyaslide::PageBase
22
+ def header
23
+ h2(nil, "Slide")
24
+ end
25
+
26
+ def content
27
+ [].tap do |children|
28
+ children << ul(nil,
29
+ li(nil, "Listing"),
30
+ li(nil, "...")
31
+ )
32
+ end
33
+ end
34
+ end
35
+
36
+ Hyaslide.page_count = 3
37
+ Hyaslide.title = "Title"
@@ -0,0 +1,38 @@
1
+ require 'sinatra'
2
+ require 'opal'
3
+ require 'opal/sprockets'
4
+
5
+ class Server < Sinatra::Base
6
+
7
+ def sprockets
8
+ settings.opal.sprockets
9
+ end
10
+
11
+ configure do
12
+ opal = Opal::Server.new do |server|
13
+ server.append_path 'data'
14
+ server.append_path 'app'
15
+ server.append_path 'assets'
16
+
17
+ Opal.use_gem 'opal-router'
18
+ Opal.use_gem 'hyalite'
19
+ Opal.use_gem 'hyaslide'
20
+
21
+ Opal.paths.each {|path| server.append_path path }
22
+
23
+ server.main = 'application'
24
+ end
25
+
26
+ set :opal, opal
27
+ enable :sessions
28
+ end
29
+
30
+ get '/' do
31
+ haml :index
32
+ end
33
+
34
+ get "/favicon.ico" do
35
+ end
36
+ end
37
+
38
+
@@ -0,0 +1,13 @@
1
+ !!!
2
+ %html(lang="en" data-framework="hyalite")
3
+ %head
4
+ %meta{charset:"utf-8"}
5
+ %title Writting web application in Ruby
6
+ %link{rel:"stylesheet", href:"assets/css/application.css"}
7
+ %link{rel:"stylesheet", href:"assets/css/highlight.css"}
8
+
9
+ %body
10
+ %section.hyaslide
11
+
12
+ = ::Opal::Sprockets.javascript_include_tag('application', sprockets: settings.opal.sprockets, prefix: 'assets', debug: true)
13
+
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hyaslide
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - youchan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-21 00:00:00.000000000 Z
11
+ date: 2016-09-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sinatra
@@ -164,6 +164,20 @@ dependencies:
164
164
  - - ">="
165
165
  - !ruby/object:Gem::Version
166
166
  version: '0'
167
+ - !ruby/object:Gem::Dependency
168
+ name: rack
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - "~>"
172
+ - !ruby/object:Gem::Version
173
+ version: '1.6'
174
+ type: :runtime
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - "~>"
179
+ - !ruby/object:Gem::Version
180
+ version: '1.6'
167
181
  - !ruby/object:Gem::Dependency
168
182
  name: bundler
169
183
  requirement: !ruby/object:Gem::Requirement
@@ -220,24 +234,24 @@ files:
220
234
  - lib/hyaslide.rb
221
235
  - lib/hyaslide/cli.rb
222
236
  - lib/hyaslide/render_hyaslide.rb
223
- - lib/hyaslide/server.rb
224
237
  - lib/hyaslide/slide_loader.rb
225
238
  - lib/hyaslide/version.rb
226
239
  - template/project/Gemfile
227
- - template/project/Gemfile.lock
228
240
  - template/project/app/application.rb
229
241
  - template/project/app/page_base.rb
230
242
  - template/project/app/track_field.rb
243
+ - template/project/assets/css/application.css
244
+ - template/project/assets/css/highlight.css
245
+ - template/project/assets/fonts/Inconsolata-Regular.ttf
246
+ - template/project/assets/images/flag.png
247
+ - template/project/assets/images/rabbit.png
248
+ - template/project/assets/images/turtle.png
231
249
  - template/project/config.ru
232
- - template/project/css/application.css
233
- - template/project/css/highlight.css
234
250
  - template/project/data/css/custom.css
251
+ - template/project/data/pages/pages.rb
235
252
  - template/project/data/slide.md
236
- - template/project/fonts/Inconsolata-Regular.ttf
237
- - template/project/images/flag.png
238
- - template/project/images/rabbit.png
239
- - template/project/images/turtle.png
240
- - template/project/index.html.haml
253
+ - template/project/server.rb
254
+ - template/project/views/index.haml
241
255
  homepage: https://github.com/youchan/hyalide
242
256
  licenses:
243
257
  - MIT
File without changes
@@ -1,96 +0,0 @@
1
- GIT
2
- remote: git://github.com/adambeynon/opal-router.git
3
- revision: bc8c242510794ecbb842b52423732f2ec55c2a1e
4
- specs:
5
- opal-router (0.0.1)
6
- opal (>= 0.3.44)
7
-
8
- GIT
9
- remote: git://github.com/opal/opal-haml.git
10
- revision: ca3d7339098dc115c0cedb9f1aeccd1f7187dd71
11
- specs:
12
- opal-haml (0.4.1)
13
- haml
14
- opal (>= 0.5.0, < 1.0.0)
15
-
16
- PATH
17
- remote: ../..
18
- specs:
19
- hyaslide (0.1.0)
20
- eventmachine
21
- fssm
22
- haml
23
- redcarpet
24
- rouge
25
- sass
26
- sinatra
27
- sinatra-contrib
28
- thin
29
- unindent
30
-
31
- GEM
32
- remote: https://rubygems.org/
33
- specs:
34
- backports (3.6.8)
35
- concurrent-ruby (1.0.2)
36
- daemons (1.2.4)
37
- eventmachine (1.2.0.1)
38
- fssm (0.2.10)
39
- haml (4.0.7)
40
- tilt
41
- hike (1.2.3)
42
- hyalite (0.0.2)
43
- opal
44
- opal-browser
45
- multi_json (1.12.1)
46
- opal (0.10.2)
47
- hike (~> 1.2)
48
- sourcemap (~> 0.1.0)
49
- sprockets (~> 3.1)
50
- tilt (>= 1.4)
51
- opal-browser (0.2.0)
52
- opal
53
- paggio
54
- paggio (0.2.6)
55
- rack (1.6.4)
56
- rack-protection (1.5.3)
57
- rack
58
- rack-test (0.6.3)
59
- rack (>= 1.0)
60
- redcarpet (3.3.4)
61
- rouge (2.0.6)
62
- sass (3.4.22)
63
- sinatra (1.4.7)
64
- rack (~> 1.5)
65
- rack-protection (~> 1.4)
66
- tilt (>= 1.3, < 3)
67
- sinatra-contrib (1.4.7)
68
- backports (>= 2.0)
69
- multi_json
70
- rack-protection
71
- rack-test
72
- sinatra (~> 1.4.0)
73
- tilt (>= 1.3, < 3)
74
- sourcemap (0.1.1)
75
- sprockets (3.7.0)
76
- concurrent-ruby (~> 1.0)
77
- rack (> 1, < 3)
78
- thin (1.7.0)
79
- daemons (~> 1.0, >= 1.0.9)
80
- eventmachine (~> 1.0, >= 1.0.4)
81
- rack (>= 1, < 3)
82
- tilt (2.0.5)
83
- unindent (1.0)
84
-
85
- PLATFORMS
86
- ruby
87
-
88
- DEPENDENCIES
89
- hyalite
90
- hyaslide!
91
- opal-browser
92
- opal-haml!
93
- opal-router!
94
-
95
- BUNDLED WITH
96
- 1.12.5
@@ -1,14 +0,0 @@
1
- !!!
2
- %html(lang="en" data-framework="hyalite")
3
- %head
4
- %meta{charset:"utf-8"}
5
- %title Writting web application in Ruby
6
- %link{rel:"stylesheet", href:"css/application.css"}
7
- %link{rel:"stylesheet", href:"data/css/custom.css"}
8
- %link{rel:"stylesheet", href:"css/highlight.css"}
9
-
10
- %body
11
- %section.hyaslide
12
-
13
- = javascript_include_tag 'application'
14
-