inesita 0.6.1 → 0.7.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
- SHA1:
3
- metadata.gz: ebd0043943e1e408e1ac4421368b5303d765a4b8
4
- data.tar.gz: 8e92b4325f614c34fd84ec8d2f15ec3bc7968ad2
2
+ SHA256:
3
+ metadata.gz: 593839c5dcafc20d97673e15a3cbb50e55d6fe65a6175265a5189783823fa6cd
4
+ data.tar.gz: 970ff04862576b05a37e4d0d74ae19e8188c667f709a1b23809ef892ff99a8c8
5
5
  SHA512:
6
- metadata.gz: cd2a9a5c8c580d815b1219aaf2f0b1c09a3af223a064d4560ca134ae0623bb8d235e2ed248badfebe8fce3bb08e6689b0e762672e82f4572b0306f98a4eea1e5
7
- data.tar.gz: cd8f058f70369030df6cfb9e8aebc26e759a7ac13776dbc5d07a07dc38cf06b301d5509dec9d9e83c6a7dc6a0b783496fe736941b593a800154648694db302ff
6
+ metadata.gz: 1297ed999cb39b0dd188507d1b8f94ad9345aa8116ad44a03f4a18386418efc149cd5a7bc9e5fcc39176d9f74535439d62701a5cb75a2088e3e905851ca7bc90
7
+ data.tar.gz: 5081aebace29915edf37c7ee4f06c3cd5b638b6f8bb03bcc91278508e25316c88db05010d582deb6653d07f4474aa7b371e3ab3f5bcbc1ce8cad0d630388f4b0
@@ -1,4 +1,19 @@
1
- ## [Unreleased]
1
+ ## [0.7.0] -
2
+
3
+ ### Fixes
4
+ - `thor` warrnings
5
+ - 'sprockets' warrnings
6
+
7
+ ### Changed
8
+ - Update `opal` to `0.11`
9
+ - Move templates configuration to `config.ru`
10
+
11
+ ### Removed
12
+ - remove `slim` dependency
13
+ - remove `sass` dependency
14
+
15
+
16
+ ## [0.6.1] - 2016.11.07
2
17
 
3
18
  ### Added
4
19
  - `inject` class method for `Component`
@@ -106,7 +121,8 @@
106
121
  - rename `update_dom` to `render!`
107
122
  - use `opal-browser` instead of pure javascript
108
123
 
109
- [Unreleased]: https://github.com/inesita-rb/inesita/compare/v0.5.1...HEAD
124
+ [Unreleased]: https://github.com/inesita-rb/inesita/compare/v0.6.1...HEAD
125
+ [0.6.1]: https://github.com/inesita-rb/inesita/compare/v0.5.1...v0.6.1
110
126
  [0.5.1]: https://github.com/inesita-rb/inesita/compare/v0.5.0...v0.5.1
111
127
  [0.5.0]: https://github.com/inesita-rb/inesita/compare/v0.4.1...v0.5.0
112
128
  [0.4.4]: https://github.com/inesita-rb/inesita/compare/v0.4.1...v0.4.4
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'inesita'
3
- s.version = '0.6.1'
3
+ s.version = '0.7.0'
4
4
  s.authors = ['Michał Kalbarczyk']
5
5
  s.email = 'fazibear@gmail.com'
6
6
  s.homepage = 'http://github.com/inesita-rb/inesita'
@@ -15,16 +15,15 @@ Gem::Specification.new do |s|
15
15
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
16
16
  s.require_paths = ['lib']
17
17
 
18
- s.add_dependency 'opal', '>= 0.9', '< 0.11'
19
- s.add_dependency 'opal-virtual-dom', '~> 0.5.0'
20
- s.add_dependency 'slim', '~> 3.0'
21
- s.add_dependency 'sass', '~> 3.4'
18
+ s.add_dependency 'opal', '>= 0.10.4', '< 0.12'
19
+ s.add_dependency 'opal-sprockets', '~> 0'
20
+ s.add_dependency 'opal-virtual-dom', '~> 0.6.0'
22
21
  s.add_dependency 'thor', '~> 0.19'
23
22
  s.add_dependency 'rack-rewrite', '~> 1.5'
24
23
  s.add_dependency 'listen', '~> 3.0'
25
24
 
26
25
  s.add_development_dependency 'bundler', '~> 1.0'
27
26
  s.add_development_dependency 'rspec', '~> 3.0'
28
- s.add_development_dependency 'opal-rspec', '~> 0.6.0.beta'
29
- s.add_development_dependency 'rake', '~> 11.0'
27
+ s.add_development_dependency 'opal-rspec', '~> 0.6.0'
28
+ s.add_development_dependency 'rake', '~> 12.0'
30
29
  end
@@ -1,9 +1,7 @@
1
- require 'opal'
1
+ require 'opal-sprockets'
2
2
  Opal.append_path File.expand_path('../../opal', __FILE__)
3
3
 
4
4
  require 'opal-virtual-dom'
5
- require 'slim'
6
- require 'sass'
7
5
 
8
6
  require 'listen'
9
7
 
@@ -5,8 +5,6 @@ begin
5
5
  Bundler.require
6
6
  rescue Bundler::GemfileNotFound
7
7
  require 'opal-virtual-dom'
8
- require 'slim'
9
- require 'sass'
10
8
  require 'inesita/server'
11
9
  end
12
10
 
@@ -10,26 +10,31 @@ module Inesita
10
10
 
11
11
  method_option :force,
12
12
  aliases: :f,
13
+ type: :boolean,
13
14
  default: false,
14
15
  desc: 'force overwrite'
15
16
 
16
17
  method_option :destination_dir,
17
18
  aliases: :d,
19
+ type: :string,
18
20
  default: Inesita::Config::BUILD_DIR,
19
21
  desc: 'destination directory'
20
22
 
21
23
  method_option :source_dir,
22
24
  aliases: :s,
25
+ type: :string,
23
26
  default: Inesita::Config::APP_DIR,
24
27
  desc: 'source (app) dir'
25
28
 
26
29
  method_option :static_dir,
27
30
  aliases: :t,
31
+ type: :string,
28
32
  default: Inesita::Config::STATIC_DIR,
29
33
  desc: 'static dir'
30
34
 
31
35
  method_option :dist_source_dir,
32
36
  aliases: :b,
37
+ type: :string,
33
38
  default: Inesita::Config::APP_DIST_DIR,
34
39
  desc: 'source (app) dir for dist build'
35
40
 
@@ -10,6 +10,7 @@ module Inesita
10
10
 
11
11
  method_option :force,
12
12
  aliases: :f,
13
+ type: :boolean,
13
14
  default: false,
14
15
  desc: 'force overwrite'
15
16
 
@@ -7,11 +7,13 @@ module Inesita
7
7
  desc 'server [OPTIONS]', 'Starts Inesita server'
8
8
  method_option :port,
9
9
  aliases: :p,
10
+ type: :numeric,
10
11
  default: 9292,
11
12
  desc: 'The port Inesita will listen on'
12
13
 
13
14
  method_option :host,
14
15
  aliases: :h,
16
+ type: :string,
15
17
  default: '127.0.0.1',
16
18
  desc: 'The host address Inesita will bind to'
17
19
 
@@ -1,17 +1,20 @@
1
1
  source "https://rubygems.org"
2
2
 
3
- # inesita gem
4
- gem 'inesita', '~> 0.6.0'
3
+ # inesita gems
4
+ gem 'inesita', '~> 0.7.0'
5
5
  gem 'inesita-livereload', '~> 0.1.0'
6
- gem 'inesita-router', '~> 0.1.0'
6
+ gem 'inesita-router', '~> 0.2.0'
7
7
 
8
- # add this gems to minify files on build
9
- #
8
+ # templates gems
9
+ gem 'slim'
10
+ gem 'sass'
11
+
12
+ # minification gems
10
13
  # gem 'uglifier'
11
14
  # gem 'htmlcompressor'
12
15
 
13
16
  # bootsrap assets
14
- gem 'bootstrap-sass'
17
+ gem 'bootstrap'
15
18
 
16
19
  # rails-assets are also supported
17
20
  # source 'https://rails-assets.org' do
@@ -18,7 +18,7 @@ class Application
18
18
  inject Store
19
19
 
20
20
  def render
21
- div class: 'container' do
21
+ div.container do
22
22
  component NavBar
23
23
  component router
24
24
  end
@@ -15,15 +15,15 @@ class Counter
15
15
  h4 do
16
16
  text props[:header]
17
17
  end
18
- div class: 'input-group' do
19
- span class: 'input-group-btn' do
20
- button class: 'btn btn-default', onclick: method(:dec) do
18
+ div.input_group do
19
+ span.input_group_btn do
20
+ button.btn.btn_default onclick: method(:dec) do
21
21
  text '-'
22
22
  end
23
23
  end
24
- input type: "text", class: "form-control", value: store.counter, disabled: true
25
- span class: 'input-group-btn' do
26
- button class: 'btn btn-default', onclick: -> { inc } do
24
+ input.form_control type: "text", value: store.counter, disabled: true
25
+ span.input_group_btn do
26
+ button.btn.btn_default onclick: method(:inc) do
27
27
  text '+'
28
28
  end
29
29
  end
@@ -2,7 +2,7 @@ class Description
2
2
  include Inesita::Component
3
3
 
4
4
  def render
5
- div class: 'jumbotron text-center' do
5
+ div.jumbotron.text_center.bg_light do
6
6
  p do
7
7
  text %{
8
8
  Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
@@ -2,7 +2,7 @@ class Home
2
2
  include Inesita::Component
3
3
 
4
4
  def render
5
- div.jumbotron class: 'text-center' do
5
+ div.jumbotron.text_center.bg_light do
6
6
  img src: '/static/inesita-rb.png'
7
7
  h1 do
8
8
  text "Hello I'm Inesita"
@@ -2,22 +2,20 @@ class NavBar
2
2
  include Inesita::Component
3
3
 
4
4
  def render
5
- nav class: 'navbar navbar-default' do
6
- div class: 'container' do
7
- div class: 'navbar-header' do
8
- span class: 'navbar-brand' do
9
- text '<%= config[:project_name] %>'
10
- end
11
- ul class: 'nav navbar-nav' do
12
- li class: "#{"active" if router.current_url?(:home)}" do
13
- a href: router.url_for(:home) do
14
- text 'Home'
15
- end
5
+ nav.navbar.navbar_expand_lg.navbar_light.bg_light do
6
+ span.navbar_brand do
7
+ text '<%= config[:project_name] %>'
8
+ end
9
+ div.collapse.navbar_collapse do
10
+ ul.nav.navbar_nav.mr_auto do
11
+ li.nav_item class: class_names(active: router.current_url?(:home)) do
12
+ a.nav_link href: router.url_for(:home) do
13
+ text 'Home'
16
14
  end
17
- li class: "#{"active" if router.current_url?(:description)}" do
18
- a href: router.url_for(:description) do
19
- text 'Description'
20
- end
15
+ end
16
+ li.nav_item class: class_names(active: router.current_url?(:description)) do
17
+ a.nav_link href: router.url_for(:description) do
18
+ text 'Description'
21
19
  end
22
20
  end
23
21
  end
@@ -2,8 +2,17 @@
2
2
  require 'bundler'
3
3
  Bundler.require
4
4
 
5
+ # setup slim templates
6
+ def setup(sprockets)
7
+ sprockets.register_engine(
8
+ '.slim',
9
+ Slim::Template,
10
+ silence_deprecation: true
11
+ )
12
+ end
13
+
5
14
  # you can comment this line to disable live-reload
6
15
  use Inesita::LiveReload
7
16
 
8
17
  # run inesita server
9
- run Inesita::Server.new
18
+ run Inesita::Server.new(setup_sprockets: method(:setup))
@@ -10,26 +10,31 @@ module Inesita
10
10
 
11
11
  method_option :force,
12
12
  aliases: :f,
13
+ type: :boolean,
13
14
  default: true,
14
15
  desc: 'force overwrite'
15
16
 
16
17
  method_option :destination_dir,
17
18
  aliases: :d,
19
+ type: :string,
18
20
  default: Inesita::Config::BUILD_DIR,
19
21
  desc: 'destination directory'
20
22
 
21
23
  method_option :source_dir,
22
24
  aliases: :s,
25
+ type: :string,
23
26
  default: Inesita::Config::APP_DIR,
24
27
  desc: 'source (app) dir'
25
28
 
26
29
  method_option :static_dir,
27
30
  aliases: :t,
31
+ type: :string,
28
32
  default: Inesita::Config::STATIC_DIR,
29
33
  desc: 'static dir'
30
34
 
31
35
  method_option :dist_source_dir,
32
36
  aliases: :b,
37
+ type: :string,
33
38
  default: Inesita::Config::APP_DIST_DIR,
34
39
  desc: 'source (app) dir for dist build'
35
40
 
@@ -7,16 +7,11 @@ module Inesita
7
7
  end
8
8
  end
9
9
 
10
- class SlimTransformer
11
- def self.call(input)
12
- Slim::Template.new(input[:name]) { input[:data] }.render(nil)
13
- end
14
- end
15
-
16
- class Server
10
+ class Server
17
11
  attr_reader :assets_app
18
12
 
19
13
  def initialize(opts = {})
14
+ @setup_sprockets = opts.delete(:setup_sprockets)
20
15
  setup_dirs(opts)
21
16
  setup_env(opts)
22
17
  @assets_app = create_assets_app
@@ -67,7 +62,7 @@ module Inesita
67
62
  end
68
63
 
69
64
  def create_assets_app
70
- Opal::Server.new do |s|
65
+ Opal::Sprockets::Server.new do |s|
71
66
  s.append_path @app_dir
72
67
  if @dist
73
68
  s.append_path @app_dist_dir
@@ -83,21 +78,12 @@ module Inesita
83
78
  s.append_path p
84
79
  end if defined?(RailsAssets)
85
80
 
86
- configure_sprockets(s.sprockets)
87
- end.sprockets
88
- end
89
-
90
- def configure_sprockets(sprockets)
91
- if sprockets.respond_to?(:register_transformer)
92
- sprockets.register_mime_type 'text/html', extensions: ['.slim', '.html.slim', '.slim.html']
93
- sprockets.register_preprocessor 'text/html', SlimTransformer
94
- elsif sprockets.respond_to?(:register_engine)
95
- sprockets.register_engine '.slim', Slim::Template
96
- end
81
+ s.sprockets.context_class.class_eval do
82
+ include SprocketsContext
83
+ end
97
84
 
98
- sprockets.context_class.class_eval do
99
- include SprocketsContext
100
- end
85
+ @setup_sprockets.call(s.sprockets) if @setup_sprockets
86
+ end.sprockets
101
87
  end
102
88
 
103
89
  def create_source_maps_app
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: inesita
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michał Kalbarczyk
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-07 00:00:00.000000000 Z
11
+ date: 2018-02-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: opal
@@ -16,62 +16,48 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '0.9'
19
+ version: 0.10.4
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
- version: '0.11'
22
+ version: '0.12'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: '0.9'
29
+ version: 0.10.4
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
- version: '0.11'
32
+ version: '0.12'
33
33
  - !ruby/object:Gem::Dependency
34
- name: opal-virtual-dom
34
+ name: opal-sprockets
35
35
  requirement: !ruby/object:Gem::Requirement
36
36
  requirements:
37
37
  - - "~>"
38
38
  - !ruby/object:Gem::Version
39
- version: 0.5.0
39
+ version: '0'
40
40
  type: :runtime
41
41
  prerelease: false
42
42
  version_requirements: !ruby/object:Gem::Requirement
43
43
  requirements:
44
44
  - - "~>"
45
45
  - !ruby/object:Gem::Version
46
- version: 0.5.0
46
+ version: '0'
47
47
  - !ruby/object:Gem::Dependency
48
- name: slim
49
- requirement: !ruby/object:Gem::Requirement
50
- requirements:
51
- - - "~>"
52
- - !ruby/object:Gem::Version
53
- version: '3.0'
54
- type: :runtime
55
- prerelease: false
56
- version_requirements: !ruby/object:Gem::Requirement
57
- requirements:
58
- - - "~>"
59
- - !ruby/object:Gem::Version
60
- version: '3.0'
61
- - !ruby/object:Gem::Dependency
62
- name: sass
48
+ name: opal-virtual-dom
63
49
  requirement: !ruby/object:Gem::Requirement
64
50
  requirements:
65
51
  - - "~>"
66
52
  - !ruby/object:Gem::Version
67
- version: '3.4'
53
+ version: 0.6.0
68
54
  type: :runtime
69
55
  prerelease: false
70
56
  version_requirements: !ruby/object:Gem::Requirement
71
57
  requirements:
72
58
  - - "~>"
73
59
  - !ruby/object:Gem::Version
74
- version: '3.4'
60
+ version: 0.6.0
75
61
  - !ruby/object:Gem::Dependency
76
62
  name: thor
77
63
  requirement: !ruby/object:Gem::Requirement
@@ -148,28 +134,28 @@ dependencies:
148
134
  requirements:
149
135
  - - "~>"
150
136
  - !ruby/object:Gem::Version
151
- version: 0.6.0.beta
137
+ version: 0.6.0
152
138
  type: :development
153
139
  prerelease: false
154
140
  version_requirements: !ruby/object:Gem::Requirement
155
141
  requirements:
156
142
  - - "~>"
157
143
  - !ruby/object:Gem::Version
158
- version: 0.6.0.beta
144
+ version: 0.6.0
159
145
  - !ruby/object:Gem::Dependency
160
146
  name: rake
161
147
  requirement: !ruby/object:Gem::Requirement
162
148
  requirements:
163
149
  - - "~>"
164
150
  - !ruby/object:Gem::Version
165
- version: '11.0'
151
+ version: '12.0'
166
152
  type: :development
167
153
  prerelease: false
168
154
  version_requirements: !ruby/object:Gem::Requirement
169
155
  requirements:
170
156
  - - "~>"
171
157
  - !ruby/object:Gem::Version
172
- version: '11.0'
158
+ version: '12.0'
173
159
  description: Frontent web framework for Opal
174
160
  email: fazibear@gmail.com
175
161
  executables:
@@ -220,10 +206,7 @@ files:
220
206
  - opal/inesita/injection.rb
221
207
  - spec/lib/nil_spec.rb
222
208
  - spec/lib/spec_helper.rb
223
- - spec/opal/application_spec.rb
224
209
  - spec/opal/component_spec.rb
225
- - spec/opal/injecion_spec.rb
226
- - spec/opal/layout_spec.rb
227
210
  - spec/opal/spec_helper.rb
228
211
  homepage: http://github.com/inesita-rb/inesita
229
212
  licenses:
@@ -246,15 +229,12 @@ required_rubygems_version: !ruby/object:Gem::Requirement
246
229
  version: '0'
247
230
  requirements: []
248
231
  rubyforge_project:
249
- rubygems_version: 2.5.1
232
+ rubygems_version: 2.7.6
250
233
  signing_key:
251
234
  specification_version: 4
252
235
  summary: Frontend web framework for Opal
253
236
  test_files:
254
237
  - spec/lib/nil_spec.rb
255
238
  - spec/lib/spec_helper.rb
256
- - spec/opal/application_spec.rb
257
239
  - spec/opal/component_spec.rb
258
- - spec/opal/injecion_spec.rb
259
- - spec/opal/layout_spec.rb
260
240
  - spec/opal/spec_helper.rb
@@ -1,23 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Inesita::Application do
4
- let(:application) { Inesita::Application }
5
- let(:layout) { Class.new { include Inesita::Layout } }
6
- let(:injection) { Class.new { include Inesita::Injection } }
7
-
8
- it 'should respond to #render' do
9
- expect(application.new(layout: layout)).to respond_to(:render)
10
- end
11
-
12
- it 'should fail with wrong :layout class' do
13
- expect { application.new(layout: Class) }.to raise_error Inesita::Error
14
- end
15
-
16
- it 'should not fail with :layout class' do
17
- expect { application.new(layout: layout) }.not_to raise_error
18
- end
19
-
20
- it 'should not fail with any class for injection' do
21
- expect { application.new(layout: layout, test: injection) }.not_to raise_error
22
- end
23
- end
@@ -1,19 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Inesita::Injection do
4
- let(:application) { Inesita::Application }
5
- let(:injection) { Class.new { include Inesita::Injection } }
6
- let(:layout) { Class.new { include Inesita::Layout } }
7
-
8
- it 'should respond to #render!' do
9
- expect(injection.new).to respond_to(:render!)
10
- end
11
-
12
- it 'should respond to #root_component' do
13
- expect(injection.new).to respond_to(:root_component)
14
- end
15
-
16
- it 'should respond to injection name method' do
17
- expect(application.new(layout: layout, test: injection)).to respond_to(:test)
18
- end
19
- end
@@ -1,9 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Inesita::Layout do
4
- let(:layout) { Class.new { include Inesita::Layout } }
5
-
6
- it 'should respond to #outlet' do
7
- expect(layout.new).to respond_to(:outlet)
8
- end
9
- end