inesita 0.6.0.beta.1 → 0.6.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: a7412161a77addc91ce85fcccbacd0a39b19178e
4
- data.tar.gz: 7232fb211110ecfd8484a305b7f484da8c1e9e35
3
+ metadata.gz: a4af46b9ab8707bb03968bde0b4beda09894b69b
4
+ data.tar.gz: 99f66a30f65e42494ba028884c0d6cd26664385c
5
5
  SHA512:
6
- metadata.gz: 8c067ebc1c05e247cdb1d6606881e5c9d7a928c172887e1bd6921d51e49396439228e32ed9dd8317bb23652bd0aee4873558f79b11be13d63f1003990d100837
7
- data.tar.gz: b28611e8b6feaa466b8fa74e7b7b466595033f9e381bf595252581454ceda36c135799a7d61dd87141fd56a706b6c31df44c158007790e4ec92a3532b1b07f1c
6
+ metadata.gz: 06617db1b020e60dad7b8c1727a450cadd5de57d70aecd1f99cb95217af26ce818aa10f7582c89e3f86fb4d3dd5cce2f003e04d3df5cd90379f90eba91bdb96a
7
+ data.tar.gz: 61cf72bc98ede6785decee36455ca3576ef6cf7d6f2fe60095d59c5e23ef674ca9d3d591e7221d070ae02e417ed83b8f5e8f8e735776bc427e0ea9f5a585bc95
@@ -1,8 +1,14 @@
1
1
  ## [Unreleased]
2
2
 
3
- ### Removed
4
- - `router` - moved to separate gem
3
+ ### Added
4
+ - `inject` class method for `Component`
5
+ - `init` callbacks
5
6
 
7
+ ### Removed
8
+ - `router` - moved to separate gem
9
+ - `Store` - use `Injection`
10
+ - `Application` - use `Component` and `inject`
11
+ - `Layout` - use component instead
6
12
 
7
13
  ## [0.5.1] - 2016.10.29
8
14
 
data/README.md CHANGED
@@ -6,7 +6,7 @@ Inesita is a web frontend framework for fast building browser application using
6
6
 
7
7
  ## Description
8
8
 
9
- More detailed description [here](https://inesita-rb.github.io).
9
+ More detailed description [here](https://inesita.fazibear.me).
10
10
 
11
11
  ## Examples
12
12
 
@@ -1,12 +1,14 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'inesita'
3
- s.version = '0.6.0.beta.1'
3
+ s.version = '0.6.0'
4
4
  s.authors = ['Michał Kalbarczyk']
5
5
  s.email = 'fazibear@gmail.com'
6
6
  s.homepage = 'http://github.com/inesita-rb/inesita'
7
7
  s.summary = 'Frontend web framework for Opal'
8
8
  s.description = 'Frontent web framework for Opal'
9
9
  s.license = 'MIT'
10
+ s.post_install_message = 'Notice! Inesita 0.6.0 includes lots of breaking changes. See documentaion: https://inesita.fazibear.me/'
11
+
10
12
 
11
13
  s.files = `git ls-files`.split("\n")
12
14
  s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
@@ -14,7 +16,7 @@ Gem::Specification.new do |s|
14
16
  s.require_paths = ['lib']
15
17
 
16
18
  s.add_dependency 'opal', '>= 0.9', '< 0.11'
17
- s.add_dependency 'opal-virtual-dom', '~> 0.4.0'
19
+ s.add_dependency 'opal-virtual-dom', '~> 0.5.0'
18
20
  s.add_dependency 'slim', '~> 3.0'
19
21
  s.add_dependency 'sass', '~> 3.4'
20
22
  s.add_dependency 'thor', '~> 0.19'
@@ -1,5 +1,6 @@
1
1
  # require Inesita
2
2
  require 'inesita'
3
+ require 'inesita-router'
3
4
 
4
5
  # require main parts of application
5
6
  require 'router'
@@ -0,0 +1,32 @@
1
+ class Counter
2
+ include Inesita::Component
3
+
4
+ def inc
5
+ store.increase
6
+ render!
7
+ end
8
+
9
+ def dec
10
+ store.decrease
11
+ render!
12
+ end
13
+
14
+ def render
15
+ h4 do
16
+ text props[:header]
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
21
+ text '-'
22
+ end
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
27
+ text '+'
28
+ end
29
+ end
30
+ end
31
+ end
32
+ end
@@ -2,14 +2,12 @@ class Home
2
2
  include Inesita::Component
3
3
 
4
4
  def render
5
- div class: 'jumbotron text-center' do
5
+ div.jumbotron class: 'text-center' do
6
6
  img src: '/static/inesita-rb.png'
7
7
  h1 do
8
8
  text "Hello I'm Inesita"
9
9
  end
10
- h4 do
11
- text 'This is a sample component'
12
- end
10
+ component Counter, props: {header: 'This is a sample counter'}
13
11
  end
14
12
  end
15
13
  end
@@ -1,15 +1,17 @@
1
1
  class Store
2
2
  include Inesita::Injection
3
3
 
4
- def initialize
5
- @store = {}
4
+ attr_accessor :counter
5
+
6
+ def init
7
+ @counter = 0
6
8
  end
7
9
 
8
- def set(key, value)
9
- @store[key] = value
10
+ def increase
11
+ @counter += 1
10
12
  end
11
13
 
12
- def get(key)
13
- @store[key]
14
+ def decrease
15
+ @counter -= 1
14
16
  end
15
17
  end
@@ -19,7 +19,8 @@ module Inesita
19
19
  before_render
20
20
  @cache_component_counter = 0
21
21
  @__virtual_nodes__ = []
22
- render.to_vnode
22
+ render
23
+ to_vnode
23
24
  end
24
25
  end
25
26
  end
@@ -24,12 +24,12 @@ module Inesita
24
24
  @injections[name] = clazz
25
25
  .new
26
26
  .with_root_component(@root_component)
27
- .inject
28
27
  else
29
28
  raise Error, "Invalid #{clazz} class, should mixin Inesita::Injection"
30
29
  end
31
30
  end
32
31
  @injections.each do |key, instance|
32
+ instance.inject
33
33
  instance.init
34
34
  end
35
35
  end
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.0.beta.1
4
+ version: 0.6.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-05 00:00:00.000000000 Z
11
+ date: 2016-11-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: opal
@@ -36,14 +36,14 @@ dependencies:
36
36
  requirements:
37
37
  - - "~>"
38
38
  - !ruby/object:Gem::Version
39
- version: 0.4.0
39
+ version: 0.5.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.4.0
46
+ version: 0.5.0
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: slim
49
49
  requirement: !ruby/object:Gem::Requirement
@@ -194,7 +194,8 @@ files:
194
194
  - lib/inesita/cli/template/.gitignore.tt
195
195
  - lib/inesita/cli/template/Gemfile.tt
196
196
  - lib/inesita/cli/template/README.md.tt
197
- - lib/inesita/cli/template/app/application.js.rb.tt
197
+ - lib/inesita/cli/template/app/application.rb.tt
198
+ - lib/inesita/cli/template/app/components/counter.rb.tt
198
199
  - lib/inesita/cli/template/app/components/description.rb.tt
199
200
  - lib/inesita/cli/template/app/components/home.rb.tt
200
201
  - lib/inesita/cli/template/app/components/navbar.rb.tt
@@ -228,7 +229,8 @@ homepage: http://github.com/inesita-rb/inesita
228
229
  licenses:
229
230
  - MIT
230
231
  metadata: {}
231
- post_install_message:
232
+ post_install_message: 'Notice! Inesita 0.6.0 includes lots of breaking changes. See
233
+ documentaion: https://inesita.fazibear.me/'
232
234
  rdoc_options: []
233
235
  require_paths:
234
236
  - lib
@@ -239,9 +241,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
239
241
  version: '0'
240
242
  required_rubygems_version: !ruby/object:Gem::Requirement
241
243
  requirements:
242
- - - ">"
244
+ - - ">="
243
245
  - !ruby/object:Gem::Version
244
- version: 1.3.1
246
+ version: '0'
245
247
  requirements: []
246
248
  rubyforge_project:
247
249
  rubygems_version: 2.5.1