wagn 1.13.0.pre1 → 1.13.0.pre2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. checksums.yaml +4 -4
  2. data/VERSION +1 -1
  3. data/app/controllers/card_controller.rb +3 -3
  4. data/db/migrate_cards/20140307231621_user_data_to_cards.rb +5 -1
  5. data/lib/card.rb +5 -7
  6. data/lib/card/chunk.rb +1 -0
  7. data/lib/card/codename.rb +48 -31
  8. data/lib/card/env.rb +0 -1
  9. data/lib/card/exceptions.rb +3 -3
  10. data/lib/card/format.rb +89 -166
  11. data/lib/card/generators/set/USAGE +1 -1
  12. data/lib/card/loader.rb +1 -1
  13. data/lib/card/set.rb +196 -112
  14. data/lib/card/set_pattern.rb +37 -71
  15. data/lib/wagn/cache.rb +8 -7
  16. data/lib/wagn/commands.rb +1 -1
  17. data/lib/wagn/config/environments/development.rb +1 -1
  18. data/lib/wagn/config/initializers/paperclip.rb +1 -0
  19. data/lib/wagn/generators/wagn/templates/Gemfile +59 -55
  20. data/lib/wagn/location.rb +2 -2
  21. data/mods/core/formats/html_format.rb +2 -6
  22. data/mods/core/formats/text_format.rb +1 -1
  23. data/mods/core/set_patterns/01_all.rb +0 -5
  24. data/mods/core/set_patterns/02_all_plus.rb +1 -3
  25. data/mods/core/set_patterns/07_type_plus_right.rb +0 -1
  26. data/mods/core/sets/all/active_card.rb +1 -1
  27. data/mods/core/sets/all/name.rb +3 -2
  28. data/mods/core/sets/all/pattern.rb +9 -23
  29. data/mods/core/sets/all/phases.rb +27 -13
  30. data/mods/core/sets/all/rules.rb +3 -3
  31. data/mods/core/sets/all/templating.rb +5 -2
  32. data/mods/core/sets/all/tracked_attributes.rb +2 -1
  33. data/mods/core/sets/right/structure.rb +13 -0
  34. data/mods/{standard → core}/sets/type/plain_text.rb +0 -0
  35. data/mods/standard/formats/email_html_format.rb +1 -1
  36. data/mods/standard/lib/card/machine.rb +16 -12
  37. data/mods/standard/lib/card/machine_input.rb +1 -1
  38. data/mods/standard/sets/all/attach.rb +1 -1
  39. data/mods/standard/sets/all/base.rb +92 -94
  40. data/mods/standard/sets/all/follow.rb +1 -1
  41. data/mods/standard/sets/all/rich_html.rb +5 -3
  42. data/mods/standard/sets/all/rss.rb +12 -5
  43. data/mods/standard/sets/right/account.rb +1 -1
  44. data/mods/standard/sets/right/add_help.rb +3 -1
  45. data/mods/standard/sets/right/comment.rb +92 -3
  46. data/mods/standard/sets/right/create.rb +2 -87
  47. data/mods/standard/sets/right/default.rb +3 -2
  48. data/mods/standard/sets/right/delete.rb +2 -5
  49. data/mods/standard/sets/right/help.rb +3 -1
  50. data/mods/standard/sets/right/machine_output.rb +9 -7
  51. data/mods/standard/sets/right/read.rb +2 -5
  52. data/mods/standard/sets/right/style.rb +3 -2
  53. data/mods/standard/sets/right/update.rb +2 -5
  54. data/mods/standard/sets/rstar/rules.rb +0 -2
  55. data/mods/standard/sets/self/head.rb +2 -3
  56. data/mods/standard/sets/self/navbox.rb +0 -7
  57. data/mods/standard/sets/self/recent.rb +2 -2
  58. data/mods/standard/sets/self/search.rb +10 -3
  59. data/mods/standard/sets/self/signin.rb +3 -3
  60. data/mods/standard/sets/type/cardtype.rb +2 -2
  61. data/mods/standard/sets/type/coffee_script.rb +4 -4
  62. data/mods/standard/sets/type/css.rb +12 -4
  63. data/mods/standard/sets/type/image.rb +19 -19
  64. data/mods/standard/sets/type/java_script.rb +1 -1
  65. data/mods/standard/sets/type/layout_type.rb +3 -2
  66. data/mods/standard/sets/type/pointer.rb +3 -2
  67. data/mods/standard/sets/type/scss.rb +6 -34
  68. data/mods/standard/sets/type/search_type.rb +22 -16
  69. data/mods/standard/sets/type/set.rb +2 -2
  70. data/mods/standard/sets/type/setting.rb +2 -2
  71. data/mods/standard/sets/type/skin.rb +4 -18
  72. data/spec/controllers/card_controller_spec.rb +2 -2
  73. data/spec/lib/card/flexmail_spec.rb +1 -0
  74. data/spec/lib/card/format_spec.rb +9 -9
  75. data/spec/lib/card/loader_spec.rb +1 -2
  76. data/spec/lib/card/name_spec.rb +7 -1
  77. data/spec/lib/card/set_pattern_spec.rb +5 -5
  78. data/spec/mods/core/sets/all/pattern_spec.rb +0 -9
  79. data/spec/mods/core/sets/all/phases_spec.rb +2 -1
  80. data/spec/mods/standard/lib/machine_input_spec.rb +20 -4
  81. data/spec/mods/standard/lib/machine_spec.rb +64 -14
  82. data/spec/mods/standard/sets/right/machine_output_spec.rb +2 -17
  83. data/spec/mods/standard/sets/right/script_spec.rb +9 -5
  84. data/spec/mods/standard/sets/right/style_spec.rb +11 -5
  85. data/spec/mods/standard/sets/type/coffeescript_spec.rb +5 -7
  86. data/spec/mods/standard/sets/type/css_spec.rb +3 -4
  87. data/spec/mods/standard/sets/type/javascript_spec.rb +3 -5
  88. data/spec/mods/standard/sets/type/scss_spec.rb +4 -7
  89. data/spec/mods/standard/sets/type/skin_spec.rb +29 -8
  90. metadata +5 -4
  91. data/mods/standard/sets/right/structure.rb +0 -12
@@ -1,5 +1,6 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
 
3
3
  describe Card::Set::All::Phases do
4
- # SPECSTUB
4
+
5
+ # how to test abort directly? set up a stub set module and include it by hand?
5
6
  end
@@ -10,6 +10,10 @@ shared_examples_for 'machine input' do
10
10
  f.putty
11
11
  f
12
12
  end
13
+ let!(:more_input) do
14
+ moreinput = create_another_machine_input_card
15
+ moreinput
16
+ end
13
17
 
14
18
  context 'when removed' do
15
19
  it 'updates machine_input card of machine card' do
@@ -21,7 +25,7 @@ shared_examples_for 'machine input' do
21
25
  expect(f.machine_input_card.item_cards).to eq([])
22
26
  end
23
27
 
24
- it 'updates file of machine card' do
28
+ it 'updates output of machine card' do
25
29
  machine
26
30
  Card::Auth.as_bot do
27
31
  input.delete!
@@ -37,11 +41,23 @@ shared_examples_for 'machine input' do
37
41
  end
38
42
 
39
43
  context 'when updated' do
40
- it 'updates file of related factory card' do
41
- input.putty :content => card_content[:new_in]
44
+ it 'updates output of related machine card' do
45
+ input.putty :content => card_content[:changed_in]
42
46
  updated_machine = Card.gimme machine.cardname
43
47
  path = updated_machine.machine_output_path
44
- expect(File.read path).to eq(card_content[:new_out])
48
+ expect(File.read path).to eq(card_content[:changed_out])
49
+ end
50
+ end
51
+
52
+ context 'when added' do
53
+ it 'updates output of related machine card' do
54
+ if machine.kind_of? Card::Set::Type::Pointer
55
+ machine << more_input
56
+ machine.putty
57
+ updated_machine = Card.gimme machine.cardname
58
+ path = updated_machine.machine_output_path
59
+ expect(File.read path).to eq( ([card_content[:out]]*2).join("\n"))
60
+ end
45
61
  end
46
62
  end
47
63
  end
@@ -21,7 +21,7 @@ shared_examples_for 'machine' do |filetype|
21
21
  it 'has +machine_output card' do
22
22
  machine.machine_output_card.should_not be_nil
23
23
  end
24
- it "generates #{filetype} file" do
24
+ it "generates #{filetype} file" do
25
25
  expect(machine.machine_output_path).to match(/\.#{filetype}$/)
26
26
  end
27
27
  end
@@ -45,9 +45,9 @@ shared_examples_for 'content machine' do |filetype|
45
45
  end
46
46
  it "updates #{filetype} file when content is changed" do
47
47
  changed_factory = machine_card
48
- changed_factory.putty :content =>card_content[:new_in]
48
+ changed_factory.putty :content =>card_content[:changed_in]
49
49
  changed_path = changed_factory.machine_output_path
50
- expect(File.read(changed_path)).to eq(card_content[:new_out])
50
+ expect(File.read(changed_path)).to eq(card_content[:changed_out])
51
51
  end
52
52
  end
53
53
  end
@@ -55,25 +55,51 @@ end
55
55
 
56
56
  shared_examples_for 'pointer machine' do |filetype|
57
57
  subject do
58
+ =begin
59
+ We build the following structure:
60
+
61
+ #{machine_card}
62
+ |- expected_input_items (passed by the calling test if it prepopulates the machine_card with some additional items)
63
+ |_ level 0 #{filetype}
64
+ |- level 1 basic 1
65
+ |- level 1 #{filetype}
66
+ | |- level 2 basic 1
67
+ | |- level 2 #{filetype}
68
+ | | |_ ....
69
+ | |_ level 2 basic 2
70
+ |_ level 1 basic 2
71
+
72
+ =end
73
+
58
74
  change_machine = machine_card
59
- @depth = 4
60
- @expected_items = []
75
+ @depth = 2
76
+ @leaf_items = []
77
+ @expected_items = expected_input_items || []
78
+ start = @expected_items.size
61
79
  Card::Auth.as_bot do
62
- (2*@depth).times do |i|
63
- @expected_items << Card.fetch( "basic level #{i}", :new => {:type => Card::BasicID } )
64
- @expected_items.last.save
80
+ @depth.times do |i|
81
+ @leaf_items << Card.fetch( "level #{i} basic 1", :new => {:type => Card::BasicID } )
82
+ @leaf_items.last.save
83
+ @leaf_items << Card.fetch( "level #{i} basic 2", :new => {:type => Card::BasicID } )
84
+ @leaf_items.last.save
65
85
  end
86
+
87
+ # we build the tree from bottom up
66
88
  last_level = false
67
- @depth.times do |i|
68
- next_level = Card.fetch( "#{filetype} level #{@depth-i}", :new => {:type => :pointer } )
89
+ (@depth-1).downto(0) do |i|
90
+ next_level = Card.fetch( "level #{i} #{filetype} ", :new => {:type => :pointer } )
69
91
  next_level.content = ""
70
- next_level << @expected_items[@depth-i-1]
92
+ next_level << @leaf_items[i*2]
71
93
  next_level << last_level if last_level
72
- next_level << @expected_items[@depth+i]
94
+ next_level << @leaf_items[i*2+1]
73
95
  next_level.save!
96
+ @expected_items.insert(start, @leaf_items[i*2])
97
+ @expected_items.insert(start+1, last_level) if last_level
98
+ @expected_items << @leaf_items[i*2+1]
74
99
  last_level = next_level
75
100
  end
76
101
  change_machine << last_level
102
+ @expected_items.insert(start, last_level)
77
103
  change_machine << machine_input_card
78
104
  @expected_items << machine_input_card
79
105
  change_machine.save!
@@ -102,9 +128,33 @@ shared_examples_for 'pointer machine' do |filetype|
102
128
  end
103
129
 
104
130
  it 'updates #{filetype} file if item is changed' do
105
- machine_input_card.putty :content => card_content[:new_in]
131
+ machine_input_card.putty :content => card_content[:changed_in]
106
132
  changed_path = subject.machine_output_path
107
- expect(File.read(changed_path)).to eq(card_content[:new_out])
133
+ expect(File.read(changed_path)).to eq(card_content[:changed_out])
134
+ end
135
+
136
+ it 'updates #{filetype} file if item is added' do
137
+ Card::Auth.as_bot do
138
+ ca = Card.gimme! "pointer item", :type=>Card::SkinID, :content=>''
139
+ subject.items = [ca]
140
+ ca << another_machine_input_card
141
+ ca.save!
142
+ changed_path = subject.machine_output_path
143
+ expect(File.read(changed_path)).to eq(card_content[:new_out])
144
+ end
145
+ end
146
+
147
+ context 'a non-existent card was added as item and now created' do
148
+ it 'updates #{filetype} file' do
149
+ Card::Auth.as_bot do
150
+ subject.content = "[[non-existent input]]"
151
+ subject.save!
152
+ ca = Card.gimme! "non-existent input", :type=>input_type, :content=>card_content[:changed_in]
153
+ ca.save!
154
+ changed_path = subject.machine_output_path
155
+ expect(File.read(changed_path)).to eq(card_content[:changed_out])
156
+ end
157
+ end
108
158
  end
109
159
  end
110
160
  end
@@ -1,20 +1,5 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
 
3
- #load 'spec/mods/zfactory/lib/machine_spec.rb'
4
-
5
- describe Card::Set::Right::Script do
6
- let(:js) { 'alert( "Hi" );' }
7
- let(:compressed_js) { 'alert("Hi");' }
8
- let(:changed_js) { 'alert( "Hello" );' }
9
- let(:compressed_changed_js) { 'alert("Hello");' }
10
-
11
-
12
- it_should_behave_like 'pointer machine', that_produces_js do
13
- let(:machine_card) { Card.gimme! "test my style+*script", :type => :pointer, :content => ''}
14
- let(:machine_input_card) { Card.gimme! "test js", :type => Card::JavaScriptID, :content => js }
15
- let(:card_content) do
16
- { in: js, out: compressed_js,
17
- new_in: changed_js, new_out: compressed_changed_js }
18
- end
19
- end
3
+ describe Card::Set::Right::MachineOutput do
4
+ # tested in controller_spec.rb
20
5
  end
@@ -1,20 +1,24 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
 
3
- #load 'spec/mods/zfactory/lib/machine_spec.rb'
4
-
5
3
  describe Card::Set::Right::Script do
6
4
  let(:js) { 'alert( "Hi" );' }
7
5
  let(:compressed_js) { 'alert("Hi");' }
8
6
  let(:changed_js) { 'alert( "Hello" );' }
9
7
  let(:compressed_changed_js) { 'alert("Hello");' }
10
-
8
+ let(:new_js) { 'alert( "Hey" );' }
9
+ let(:compressed_new_js) { 'alert("Hey");' }
11
10
 
12
11
  it_should_behave_like 'pointer machine', that_produces_js do
13
12
  let(:machine_card) { Card.gimme! "test my style+*script", :type => :pointer, :content => ''}
14
13
  let(:machine_input_card) { Card.gimme! "test js", :type => Card::JavaScriptID, :content => js }
14
+ let(:another_machine_input_card) { Card.gimme! "more js", :type => Card::JavaScriptID, :content => new_js }
15
+ let(:expected_input_items) { nil }
16
+ let(:input_type) { :java_script }
15
17
  let(:card_content) do
16
- { in: js, out: compressed_js,
17
- new_in: changed_js, new_out: compressed_changed_js }
18
+ { in: js, out: compressed_js,
19
+ changed_in: changed_js, changed_out: compressed_changed_js,
20
+ new_in: new_js, new_out: compressed_new_js
21
+ }
18
22
  end
19
23
  end
20
24
  end
@@ -5,19 +5,25 @@ require File.expand_path('../../../lib/machine_spec.rb', __FILE__)
5
5
  describe Card::Set::Right::Style do
6
6
  # describe "#delet"
7
7
  # it "should delete tempfile"
8
- let(:skin_card) { Card.gimme! "test skin", :type => :skin, :content => '[[test css]]'}
8
+ #let!(:skin_card) { Card.gimme! "test skin", :type => :skin, :content => '[[test css]]'}
9
9
  let(:css) { "#box { display: block }" }
10
10
  let(:compressed_css) { "#box{display:block}\n" }
11
11
  let(:changed_css) { "#box { display: inline }" }
12
12
  let(:compressed_changed_css) { "#box{display:inline}\n" }
13
-
13
+ let(:new_css) { "#box{ display: none}\n" }
14
+ let(:compressed_new_css) { "#box{display:none}\n" }
14
15
 
15
16
  it_should_behave_like 'pointer machine', that_produces_css do
16
- let(:machine_card) { Card.gimme! "test my style+*style", :type => :pointer, :content => '[[test skin]]'}
17
+ let(:machine_card) { Card.gimme! "test my style+*style", :type => :pointer, :content => ''}
17
18
  let(:machine_input_card) { Card.gimme! "test css", :type => :css, :content => css }
19
+ let(:another_machine_input_card) { Card.gimme! "more css", :type => :css, :content => new_css }
20
+ let(:expected_input_items) { nil } #[Card.fetch("test skin"), machine_input_card] }
21
+ let(:input_type) { :css }
18
22
  let(:card_content) do
19
- { in: css, out: compressed_css,
20
- new_in: changed_css, new_out: compressed_changed_css }
23
+ { in: css, out: compressed_css,
24
+ changed_in: changed_css, changed_out: compressed_changed_css,
25
+ new_in: new_css, new_out: compressed_new_css
26
+ }
21
27
  end
22
28
  end
23
29
  end
@@ -1,6 +1,3 @@
1
- # load 'spec/mods/zfactory/lib/machine_spec.rb'
2
- # load 'spec/mods/zfactory/lib/machine_input_spec.rb'
3
-
4
1
  describe Card::Set::Type::CoffeeScript do
5
2
  let(:coffee) { 'alert "Hi" ' }
6
3
  let(:compressed_coffee) { '(function(){alert("Hi")}).call(this);' }
@@ -11,17 +8,18 @@ describe Card::Set::Type::CoffeeScript do
11
8
  it_should_behave_like 'content machine', that_produces_js do
12
9
  let(:machine_card) { Card.gimme! "test coffeescript", :type => Card::CoffeeScriptID, :content => coffee}
13
10
  let(:card_content) do
14
- { in: coffee, out: compressed_coffee,
15
- new_in: changed_coffee, new_out: compressed_changed_coffee }
11
+ { in: coffee, out: compressed_coffee,
12
+ changed_in: changed_coffee, changed_out: compressed_changed_coffee }
16
13
  end
17
14
  end
18
15
 
19
16
  it_behaves_like "machine input" do
20
17
  let(:create_machine_input_card) { Card.gimme! "test coffeescript", :type => :coffee_script, :content => coffee }
18
+ let(:create_another_machine_input_card) { Card.gimme! "more coffee", :type => :coffee_script, :content => coffee }
21
19
  let(:create_machine_card) { Card.gimme! "script with coffee+*script", :type => :pointer }
22
20
  let(:card_content) do
23
- { in: coffee, out: compressed_coffee,
24
- new_in: changed_coffee, new_out: compressed_changed_coffee }
21
+ { in: coffee, out: compressed_coffee,
22
+ changed_in: changed_coffee, changed_out: compressed_changed_coffee }
25
23
  end
26
24
  end
27
25
 
@@ -1,5 +1,3 @@
1
- # load 'spec/mods/zfactory/lib/machine_spec.rb'
2
- # load 'spec/mods/zfactory/lib/machine_input_spec.rb'
3
1
 
4
2
  describe Card::Set::Type::Css do
5
3
  let(:css) { '#box { display: block }' }
@@ -16,10 +14,11 @@ describe Card::Set::Type::Css do
16
14
 
17
15
  it_behaves_like "machine input" do
18
16
  let(:create_machine_input_card) { Card.gimme! "test css", :type => :css, :content => css }
17
+ let(:create_another_machine_input_card) { Card.gimme! "more test css", :type => :css, :content => css }
19
18
  let(:create_machine_card) { Card.gimme! "style with css+*style", :type => :pointer }
20
19
  let(:card_content) do
21
20
  { in: css, out: compressed_css,
22
- new_in: changed_css, new_out: compressed_changed_css }
21
+ changed_in: changed_css, changed_out: compressed_changed_css }
23
22
  end
24
23
  end
25
24
 
@@ -27,7 +26,7 @@ describe Card::Set::Type::Css do
27
26
  let(:machine_card) { Card.gimme! "test css", :type => :css, :content => css }
28
27
  let(:card_content) do
29
28
  { in: css, out: compressed_css,
30
- new_in: changed_css, new_out: compressed_changed_css }
29
+ changed_in: changed_css, changed_out: compressed_changed_css }
31
30
  end
32
31
  end
33
32
  end
@@ -1,6 +1,3 @@
1
- # load 'spec/mods/zfactory/lib/machine_spec.rb'
2
- # load 'spec/mods/zfactory/lib/machine_input_spec.rb'
3
-
4
1
  describe Card::Set::Type::JavaScript do
5
2
  let(:js) { 'alert( "Hi" );' }
6
3
  let(:compressed_js) { 'alert("Hi");' }
@@ -12,16 +9,17 @@ describe Card::Set::Type::JavaScript do
12
9
  let(:machine_card) { Card.gimme! "test javascript", :type => :java_script, :content => js}
13
10
  let(:card_content) do
14
11
  { in: js, out: compressed_js,
15
- new_in: changed_js, new_out: compressed_changed_js }
12
+ changed_in: changed_js, changed_out: compressed_changed_js }
16
13
  end
17
14
  end
18
15
 
19
16
  it_behaves_like "machine input" do
20
17
  let(:create_machine_input_card) { Card.gimme! "test javascript", :type => :java_script, :content => js }
18
+ let(:create_another_machine_input_card) { Card.gimme! "more javascript", :type => :java_script, :content => js }
21
19
  let(:create_machine_card) { Card.gimme! "script with js+*script", :type => :pointer }
22
20
  let(:card_content) do
23
21
  { in: js, out: compressed_js,
24
- new_in: changed_js, new_out: compressed_changed_js }
22
+ changed_in: changed_js, changed_out: compressed_changed_js }
25
23
  end
26
24
  end
27
25
 
@@ -1,9 +1,5 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
 
3
- # load 'spec/mods/zfactory/lib/machine_spec.rb'
4
- # load 'spec/mods/zfactory/lib/machine_input_spec.rb'
5
-
6
-
7
3
  describe Card::Set::Type::Scss do
8
4
  let(:scss) {
9
5
  %{
@@ -25,7 +21,7 @@ describe Card::Set::Type::Scss do
25
21
 
26
22
 
27
23
  it 'should highlight code in html' do
28
- assert_view_select @scss_card.format.render_core, 'div[class=CodeRay]'
24
+ assert_view_select @scss_card.format(:format=>:html).render_core, 'div[class=CodeRay]'
29
25
  end
30
26
 
31
27
  it 'should not highlight code in css' do
@@ -34,10 +30,11 @@ describe Card::Set::Type::Scss do
34
30
 
35
31
  it_should_behave_like "machine input" do
36
32
  let(:create_machine_input_card) { Card.gimme! "test scss", :type => :scss, :content => scss }
33
+ let(:create_another_machine_input_card) { Card.gimme! "more scss", :type => :scss, :content => scss }
37
34
  let(:create_machine_card) { Card.gimme! "style with scss+*style", :type => :pointer }
38
35
  let(:card_content) do
39
36
  { in: scss, out: compressed_css,
40
- new_in: changed_scss, new_out: compressed_changed_css }
37
+ changed_in: changed_scss, changed_out: compressed_changed_css }
41
38
  end
42
39
  end
43
40
 
@@ -45,7 +42,7 @@ describe Card::Set::Type::Scss do
45
42
  let(:machine_card) { Card.gimme! "test scss", :type => :scss, :content => scss }
46
43
  let(:card_content) do
47
44
  { in: scss, out: compressed_css,
48
- new_in: changed_scss, new_out: compressed_changed_css }
45
+ changed_in: changed_scss, changed_out: compressed_changed_css }
49
46
  end
50
47
  end
51
48
  end
@@ -5,23 +5,44 @@ describe Card::Set::Type::Skin do
5
5
  let(:compressed_css) { "#box{display:block}\n" }
6
6
  let(:changed_css) { "#box { display: inline }" }
7
7
  let(:compressed_changed_css) { "#box{display:inline}\n" }
8
-
8
+ let(:new_css) { "#box{display: none }\n" }
9
+ let(:compressed_new_css) { "#box{display:none}\n" }
9
10
 
10
11
  it_should_behave_like 'pointer machine', that_produces_css do
11
- let(:machine_card) { Card.gimme! "test skin factory", :type => :skin, :content => ''}
12
+ let(:machine_card) { Card.gimme! "test skin machine", :type => :skin, :content => ''}
12
13
  let(:machine_input_card) { Card.gimme! "test skin supplier", :type => :css, :content => css }
14
+ let(:another_machine_input_card) { Card.gimme! "more css", :type => :css, :content => new_css }
15
+ let(:expected_input_items) { nil }
16
+ let(:input_type) { :css }
13
17
  let(:card_content) do
14
- { in: css, out: compressed_css,
15
- new_in: changed_css, new_out: compressed_changed_css }
18
+ { in: css, out: compressed_css,
19
+ changed_in: changed_css, changed_out: compressed_changed_css,
20
+ new_in: new_css, new_out: compressed_new_css }
16
21
  end
17
22
  end
18
23
 
19
24
  it_behaves_like "machine input" do
20
- let(:create_machine_input_card) { Card.gimme! "test skin supplier", :type => :css, :content => css }
21
- let(:create_machine_card) { Card.gimme! "style with skin factory+*style", :type => :pointer }
25
+ let(:create_machine_input_card) { Card.gimme! "test skin input", :type => :css, :content => css }
26
+ let(:create_another_machine_input_card) { Card.gimme! "more skin input", :type => :css, :content => css }
27
+ let(:create_machine_card) { Card.gimme! "style with skin machine+*style", :type => :pointer }
22
28
  let(:card_content) do
23
- { in: css, out: compressed_css,
24
- new_in: changed_css, new_out: compressed_changed_css }
29
+ { in: css, out: compressed_css,
30
+ changed_in: changed_css, changed_out: compressed_changed_css
31
+ }
32
+ end
33
+ end
34
+
35
+ context 'when item added' do
36
+ it 'updates output of related machine card' do
37
+ #item = Card.gimme! "skin item", :type => :css, :content => css
38
+ skin = Card.gimme! "test skin supplier", :type => :skin, :content => ''
39
+ machine = Card.gimme! "style with skin machine+*style", :type => :pointer, :content=>'[[test skin supplier]]'
40
+ item = Card.gimme! "skin item", :type => :css, :content => css
41
+ skin << item
42
+ skin.putty
43
+ updated_machine = Card.gimme machine.cardname
44
+ path = updated_machine.machine_output_path
45
+ expect(File.read path).to eq( compressed_css )
25
46
  end
26
47
  end
27
48
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wagn
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.13.0.pre1
4
+ version: 1.13.0.pre2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ethan McCutchen
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2014-06-25 00:00:00.000000000 Z
13
+ date: 2014-07-07 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails
@@ -340,6 +340,7 @@ files:
340
340
  - lib/wagn/config/initializers/inflections.rb
341
341
  - lib/wagn/config/initializers/mime_types.rb
342
342
  - lib/wagn/config/initializers/notification.rb
343
+ - lib/wagn/config/initializers/paperclip.rb
343
344
  - lib/wagn/config/initializers/recaptcha.rb
344
345
  - lib/wagn/config/initializers/secret_token.rb
345
346
  - lib/wagn/config/initializers/session_store.rb
@@ -419,6 +420,8 @@ files:
419
420
  - mods/core/sets/all/trash.rb
420
421
  - mods/core/sets/all/type.rb
421
422
  - mods/core/sets/all/utils.rb
423
+ - mods/core/sets/right/structure.rb
424
+ - mods/core/sets/type/plain_text.rb
422
425
  - mods/standard/files/103/icon-6566.ico
423
426
  - mods/standard/files/103/large-6566.ico
424
427
  - mods/standard/files/103/medium-6566.ico
@@ -491,7 +494,6 @@ files:
491
494
  - mods/standard/sets/right/script.rb
492
495
  - mods/standard/sets/right/stats.rb
493
496
  - mods/standard/sets/right/status.rb
494
- - mods/standard/sets/right/structure.rb
495
497
  - mods/standard/sets/right/style.rb
496
498
  - mods/standard/sets/right/token.rb
497
499
  - mods/standard/sets/right/update.rb
@@ -531,7 +533,6 @@ files:
531
533
  - mods/standard/sets/type/layout_type.rb
532
534
  - mods/standard/sets/type/number.rb
533
535
  - mods/standard/sets/type/phrase.rb
534
- - mods/standard/sets/type/plain_text.rb
535
536
  - mods/standard/sets/type/pointer.rb
536
537
  - mods/standard/sets/type/scss.rb
537
538
  - mods/standard/sets/type/search_type.rb