sombrero 0.0.8 → 0.1.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: ef0fd1444aebb7291dd470b2c3e35db00513223c
4
- data.tar.gz: af0edc1f6a1b5475e04335b694e2b2827a3918f9
3
+ metadata.gz: 728b3df0b0b89665e7e5fec06812414d325ce620
4
+ data.tar.gz: b998ce6174285cb33b7341de46fa544b51570e45
5
5
  SHA512:
6
- metadata.gz: 49969a561c69d8b4fce496b0c5672717212248ee88cb6412d5911499f1e7624875dcf21f85dcb488ad4701a10c523f79b55889437ceff62349b77302aad058f9
7
- data.tar.gz: de203e8f601fd26b183e919162b3e9e64395a81f61fc81aab4e9298413d296775943ebada454afe9d3003f770af11340920a6b1fbccd271854679ec6ddfbe805
6
+ metadata.gz: b6c9fa48d4bf329d99bd65de7fa29b4a448e47714bc821ed0e92a0b421419fca3736346a19a8631d327142770355295ddc0402bb719b58cbc13a5e3047d5492b
7
+ data.tar.gz: f2764813e9c382d4c902e791c6c1702343ee09aba12f4db7b2f21e1f50b8af9fae55100f6beabd65ad13f073b7ba303c9a2246385abd8fad1b007ff73eb73aa5
File without changes
File without changes
@@ -1,12 +1,12 @@
1
- class RTCPController < BaseController
2
- map Cfg.baseurl + '__rtcp__'
1
+ class RTCPController < Sombrero::RTCPController
2
+ map File.join(Cfg.baseurl, '__rtcp__')
3
3
 
4
4
  private
5
- # called after socket connection established.
5
+ # called after socket connection established
6
6
  def connected
7
7
  end
8
8
 
9
- # data sent to client after connection established.
9
+ # data sent to client after connection established
10
10
  def initialization_data
11
11
  {}
12
12
  end
@@ -1,5 +1,3 @@
1
- # === Cfg is a required reserved hard-coded constant. === #
2
- # === If you change it the entire app will broke. === #
3
1
 
4
2
  # loading .yml configs from current directory. config.yml will be loaded first.
5
3
  Cfg = Sombrero.load_config(File.expand_path('..', __FILE__))
@@ -1,10 +1,11 @@
1
1
  # module SystemRequiredConfigs # Do NOT Remove!
2
2
  baseurl: /
3
3
  app:
4
- url:
4
+ baseurl:
5
5
  development: /app
6
6
  production: /app
7
- dir: ./public
7
+ # relative to webpack.config.js
8
+ path: ./public
8
9
  # end
9
10
 
10
11
  # put here configs that will be the same on all environments.
@@ -1,4 +1,4 @@
1
- # DO NOT EDIT THIS FILE
1
+ # do NOT edit this file, edit ../Gemfile instead
2
2
  gem 'sombrero'
3
3
  gem 'rocketio'
4
4
  gem 'tubesock'
@@ -1,5 +1,6 @@
1
- # DO NOT EDIT THIS FILE, all updates will be lost on next update.
2
- # edit base/boot.rb instead.
1
+ # do NOT edit this file, edit base/boot.rb instead
2
+
3
+ require 'yaml'
3
4
 
4
5
  Dir.chdir File.expand_path('../..', __FILE__) do
5
6
  require './base/boot'
@@ -12,6 +13,4 @@ Dir.chdir File.expand_path('../..', __FILE__) do
12
13
 
13
14
  require './base/helpers/application_helpers'
14
15
  Dir['./base/helpers/**/*.rb'].each {|f| require(f)}
15
-
16
- require './base/load'
17
16
  end
@@ -1,4 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
+
3
+ # do NOT edit this file
4
+
2
5
  require File.expand_path('../load', __FILE__)
3
6
 
4
7
  Sombrero.generate_controllers_map(File.expand_path('../..', __FILE__))
@@ -1,4 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
+
3
+ # do NOT edit this file
4
+
2
5
  require File.expand_path('../load', __FILE__)
3
6
 
4
7
  Sombrero.generate_webpack_setup(File.expand_path('../..', __FILE__))
@@ -1,5 +1,7 @@
1
- # DO NOT EDIT THIS FILE, all updates will be lost on next update.
2
- # edit base/load.rb instead.
1
+ # do NOT edit this file, edit base/load.rb instead
3
2
 
4
- require File.expand_path('../boot', __FILE__)
5
- require File.expand_path('../load_controllers', __FILE__)
3
+ %w[
4
+ boot
5
+ ../base/load
6
+ load_controllers
7
+ ].each {|f| require File.expand_path("../#{f}", __FILE__)}
@@ -1,5 +1,4 @@
1
- # DO NOT EDIT THIS FILE, all updates will be lost on next update.
2
- # edit base/load_controllers.rb instead.
1
+ # do NOT edit this file, edit base/load_controllers.rb instead
3
2
 
4
3
  Dir.chdir File.expand_path('../..', __FILE__) do
5
4
 
File without changes
File without changes
@@ -16,9 +16,9 @@ console.log(JSON.stringify(setup, null, 2))
16
16
  module.exports = {
17
17
  entry: setup.entries,
18
18
  output: {
19
- path: [setup.path, setup.url].join('/'),
19
+ path: [setup.path, setup.baseurl].join('/'),
20
20
  filename: '[name].js',
21
- publicPath: setup.url + '/', // trailing slash required
21
+ publicPath: setup.baseurl + '/', // trailing slash required
22
22
  libraryTarget: 'commonjs2'
23
23
  },
24
24
  module: {
@@ -39,7 +39,8 @@ module.exports = {
39
39
  resolve: {
40
40
  extensions: ['', '.js', '.css', '.json', '.coffee', '.html'],
41
41
  alias: {
42
- base: __dirname + '/base',
42
+ app: __dirname,
43
+ base: 'app/base',
43
44
  api: 'base/api',
44
45
  }
45
46
  },
@@ -89,8 +89,8 @@ module Sombrero
89
89
 
90
90
  File.open File.expand_path('webpack_setup.json', dir), 'w' do |f|
91
91
  f << {
92
- path: config[:app][:dir],
93
- url: config[:app][:url][:development],
92
+ path: config[:app][:path],
93
+ baseurl: config[:app][:baseurl][:development],
94
94
  entries: entries
95
95
  }.to_json
96
96
  end
@@ -2,6 +2,7 @@ require 'fileutils'
2
2
  require 'pathname'
3
3
  require 'yaml'
4
4
  require 'pty'
5
+ require 'sombrero/version'
5
6
  require 'sombrero/cli/helpers'
6
7
  require 'sombrero/cli/assertions'
7
8
 
@@ -20,6 +21,8 @@ module Sombrero
20
21
  generator(args)
21
22
  when 'd', 'docker'
22
23
  docker(args)
24
+ when 'v', '-v', '--version'
25
+ puts Sombrero::VERSION
23
26
  when nil, '-h', '--help'
24
27
  usage
25
28
  else
@@ -14,6 +14,7 @@ module Sombrero
14
14
  def install dir, working_dir_opted
15
15
  src = working_dir_opted ? BASE_DIR.to_path + '/.' : BASE_DIR
16
16
  FileUtils.cp_r(src, dir)
17
+ cleanup(dir)
17
18
  end
18
19
 
19
20
  def add_namespace dir, namespace
@@ -31,6 +32,10 @@ module Sombrero
31
32
  end
32
33
  end
33
34
 
35
+ def cleanup dir
36
+ Dir[dir / "**/.ignore"].each {|f| FileUtils.rm_f(f)}
37
+ end
38
+
34
39
  end
35
40
  end
36
41
  end
@@ -20,13 +20,7 @@ module Sombrero
20
20
 
21
21
  def on_open
22
22
  connected
23
- write(serial: 0, data: initialization_data.update(__initialization_data__))
24
- end
25
-
26
- def __initialization_data__
27
- {
28
- app_url: Cfg.app[:url][RocketIO.environment] || Cfg.app[:url][:development]
29
- }
23
+ write(serial: 0, data: initialization_data)
30
24
  end
31
25
 
32
26
  def on_message msg
@@ -81,5 +75,23 @@ module Sombrero
81
75
  def write data
82
76
  @socket.send_data(data.to_json)
83
77
  end
78
+
79
+ # called after socket connection established
80
+ def connected
81
+ end
82
+
83
+ # data sent to client after connection established
84
+ def initialization_data
85
+ {}
86
+ end
87
+
88
+ # merged into original env when calling a controller
89
+ def rtcp_env
90
+ {}
91
+ end
92
+
93
+ # called when socket connection closed
94
+ def disconnected
95
+ end
84
96
  end
85
97
  end
@@ -0,0 +1,3 @@
1
+ module Sombrero
2
+ VERSION = '0.1.0'.freeze
3
+ end
@@ -1,10 +1,9 @@
1
1
  # coding: utf-8
2
+ require File.expand_path('../lib/sombrero/version', __FILE__)
2
3
 
3
4
  Gem::Specification.new do |spec|
4
- spec.name, spec.version = %w[
5
- sombrero
6
- 0.0.8
7
- ]
5
+ spec.name = 'sombrero'
6
+ spec.version = Sombrero::VERSION
8
7
  spec.authors = ['Slee Woo']
9
8
  spec.email = ['mail@sleewoo.com']
10
9
  spec.summary = [spec.name, spec.version]*'-',
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sombrero
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Slee Woo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-17 00:00:00.000000000 Z
11
+ date: 2016-03-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rocketio
@@ -52,9 +52,11 @@ files:
52
52
  - app/.pryrc
53
53
  - app/Gemfile
54
54
  - app/Rakefile
55
+ - app/base/api/.ignore
55
56
  - app/base/base_controller.rb
56
57
  - app/base/boot.rb
57
58
  - app/base/helpers/application_helpers.rb
59
+ - app/base/load.rb
58
60
  - app/base/load_controllers.rb
59
61
  - app/base/rtcp_controller.rb
60
62
  - app/config.ru
@@ -70,7 +72,9 @@ files:
70
72
  - app/core/generate_webpack_setup.rb
71
73
  - app/core/load.rb
72
74
  - app/core/load_controllers.rb
75
+ - app/generators/api/.ignore
73
76
  - app/package.json
77
+ - app/public/.ignore
74
78
  - app/webpack.config.js
75
79
  - bin/sombrero
76
80
  - docker/Dockerfile
@@ -99,6 +103,7 @@ files:
99
103
  - lib/sombrero/cli/generator.rb
100
104
  - lib/sombrero/cli/helpers.rb
101
105
  - lib/sombrero/rtcp_controller.rb
106
+ - lib/sombrero/version.rb
102
107
  - sombrero.gemspec
103
108
  homepage: https://github.com/sleewoo/sombrero
104
109
  licenses:
@@ -123,5 +128,5 @@ rubyforge_project:
123
128
  rubygems_version: 2.5.1
124
129
  signing_key:
125
130
  specification_version: 4
126
- summary: '["sombrero-0.0.8", "Opinionated stack for building opinionated web applications"]'
131
+ summary: '["sombrero-0.1.0", "Opinionated stack for building opinionated web applications"]'
127
132
  test_files: []