Skip to content

Commit d1a65d0

Browse files
committed
added naming_convention method, changed version to 1.0.rc1
1 parent a8e101e commit d1a65d0

File tree

19 files changed

+79
-40
lines changed

19 files changed

+79
-40
lines changed

ruby/examples/misc/stock-tickers/Gemfile.lock

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
PATH
22
remote: ../../../hyper-component
33
specs:
4-
hyper-component (0.1)
5-
hyper-state (= 0.1)
6-
hyperstack-config (= 0.1)
4+
hyper-component (1.0.rc1)
5+
hyper-state (= 1.0.rc1)
6+
hyperstack-config (= 1.0.rc1)
77
libv8 (~> 6.3.0)
88
mini_racer (~> 0.1.15)
99
opal (>= 0.11.0, < 0.12.0)
@@ -13,7 +13,7 @@ PATH
1313
PATH
1414
remote: ../../../hyper-spec
1515
specs:
16-
hyper-spec (0.1)
16+
hyper-spec (1.0.rc1)
1717
capybara
1818
chromedriver-helper (= 1.2.0)
1919
libv8 (~> 6.3.0)
@@ -32,20 +32,20 @@ PATH
3232
PATH
3333
remote: ../../../hyper-state
3434
specs:
35-
hyper-state (0.1)
36-
hyperstack-config (= 0.1)
35+
hyper-state (1.0.rc1)
36+
hyperstack-config (= 1.0.rc1)
3737
opal (>= 0.11.0, < 0.12.0)
3838

3939
PATH
4040
remote: ../../../hyper-trace
4141
specs:
42-
hyper-trace (0.1.0)
43-
hyperstack-config (= 0.1.0)
42+
hyper-trace (1.0.rc1)
43+
hyperstack-config (= 1.0.rc1)
4444

4545
PATH
4646
remote: ../../../hyperstack-config
4747
specs:
48-
hyperstack-config (0.1)
48+
hyperstack-config (1.0.rc1)
4949
libv8 (~> 6.3.0)
5050
listen (~> 3.0)
5151
mini_racer (~> 0.1.15)

ruby/examples/misc/stock-tickers/app/hyperstack/components/app.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ class App < HyperComponent
22
before_mount { @symbols = Set.new }
33

44
def add_symbol
5-
mutate @symbols << @SymbolInput.value.upcase
6-
@SymbolInput.value = ''
5+
mutate @symbols << @_symbol_input.value.upcase
6+
@_symbol_input.value = ''
77
end
88

99
render do
@@ -15,7 +15,7 @@ def add_symbol
1515
BS::Row(style: { marginTop: 20 }) do
1616
BS::Col(sm: 4) do
1717
BS::InputGroup(class: 'mb-3') do
18-
BS::FormControl(dom: set(:SymbolInput), placeholder: 'New Stock Market Symbol')
18+
BS::FormControl(dom: set(:_symbol_input), placeholder: 'New Stock Market Symbol')
1919
.on(:enter) { add_symbol }
2020
BS::InputGroup::Append() { BS::Button() { 'Add' } }
2121
.on(:click) { add_symbol }

ruby/examples/misc/stock-tickers/app/hyperstack/components/display_ticker.rb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
class DisplayTicker < HyperComponent
22
param :symbol
33
triggers :cancel
4-
before_mount { @ticker = StockTicker.new(@Symbol, 10.seconds) }
4+
before_mount { @_ticker = StockTicker.new(@_symbol, 10.seconds) }
55

66
def status
7-
case @ticker.status
7+
case @_ticker.status
88
when :loading
99
BS::Col(sm: 10) { 'loading...' }
1010
when :success
1111
BS::Col(class: 'text-right', sm: 3) { 'price' }
12-
BS::Col(class: 'text-right', sm: 3) { '%.2f' % @ticker.price }
13-
BS::Col(sm: 4) { "at #{@ticker.time.strftime('%I:%M:%S')}" }
12+
BS::Col(class: 'text-right', sm: 3) { '%.2f' % @_ticker.price }
13+
BS::Col(sm: 4) { "at #{@_ticker.time.strftime('%I:%M:%S')}" }
1414
when :failed
15-
BS::Col(sm: 10) { "failed to get quote: #{@ticker.reason}" }
15+
BS::Col(sm: 10) { "failed to get quote: #{@_ticker.reason}" }
1616
end
1717
end
1818

1919
render do
2020
BS::Row() do
21-
BS::Col(sm: 1) { @Symbol.upcase }
21+
BS::Col(sm: 1) { @_symbol.upcase }
2222
status
2323
BS::Col(sm: 1) do
2424
BS::Button(class: :close) { "\u00D7" }
25-
.on(:click) { cancel! } unless @ticker.status == :loading
25+
.on(:click) { cancel! } unless @_ticker.status == :loading
2626
end
2727
end
2828
end

ruby/examples/misc/stock-tickers/app/hyperstack/components/hyper_component.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
module Hyperstack
2+
module State
3+
module Observable
4+
def self.naming_convention
5+
:prefix_params
6+
end
7+
end
8+
end
9+
end
10+
111
class HyperComponent
212
include Hyperstack::Component
313
include Hyperstack::State::Observable
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module Hyperstack
22
module Component
3-
VERSION = '0.1'
3+
VERSION = '1.0.rc1' # '1.0.rc1'
44
end
55
end

ruby/hyper-component/lib/hyperstack/internal/component/props_wrapper.rb

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,19 @@ class PropsWrapper
66
attr_reader :component
77

88
class << self
9-
109
def instance_var_name_for(name)
11-
name.camelize
10+
case Hyperstack::State::Observable.naming_convention
11+
when :camelize_params
12+
name.camelize
13+
when :prefix_params
14+
"_#{name}"
15+
else
16+
name
17+
end
1218
end
1319

14-
def param_accessor_style(*args)
15-
@param_accessor_style = args[0] if args.length > 0
20+
def param_accessor_style(style = nil)
21+
@param_accessor_style = style if style
1622
@param_accessor_style ||=
1723
if superclass.respond_to? :param_accessor_style
1824
superclass.param_accessor_style
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module HyperI18n
2-
VERSION = '0.1.0'
2+
VERSION = '1.0.rc1'
33
end
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module Hyperstack
22
module I18n
3-
VERSION = '0.1.0'
3+
VERSION = '1.0.rc1'
44
end
55
end
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module HyperModel
2-
VERSION = '0.1'
2+
VERSION = '1.0.rc1'
33
end

ruby/hyper-model/lib/reactive_record/active_record/reactive_record/isomorphic_base.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,6 @@ def send_save_to_server(save, validate, force, &block)
308308
backing_records.each { |_id, record| record.saved!(true) rescue nil } if save
309309
end
310310
rescue Exception => e
311-
debugger
312311
log("Exception raised while saving - #{e}", :error)
313312
yield false, e.message, [] if block
314313
promise.resolve({success: false, message: e.message, models: []})

0 commit comments

Comments
 (0)