lucidMachines 0.1.2 → 0.1.3

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e45b69e99c6fa792a59c07f778c2650116e627698dd6c7f59e19ea18d3999bdd
4
- data.tar.gz: 75161768c35466c9b18479d4e29b89a689394f64a232779892abf1c158f1cf26
3
+ metadata.gz: 620311ef6545bbd9c43e56b7a57e28d5d58d54e5b5b17294f6cbdf79b7416211
4
+ data.tar.gz: 6c8bfe52b58945a3668b8e7d775ee16b4724e3127df1972710ca97310722ddf0
5
5
  SHA512:
6
- metadata.gz: 26e5d9dc07e9a3ab1f62da9c9b0a69e6944d700051c900ab4874db4b88b20790833021afcaef0156d9d6a1e7778d5814ea1d2994f6bad4edabcac6277b1c2b0c
7
- data.tar.gz: d759259eb5c5c22f4795392efdfbacac30d140c5183f1268b79b51aebc6685da6b125ac5caebeb9e01456f0a7dbb14448fb38ed95ae496cf3b8999884f39ed5a
6
+ metadata.gz: 22632d79d422b23f2239faf36189efbf661e7c6ef666478fbda70f34279077ca343b33aa350e033648a9ce855622f98cf6914c936a80462ab0db514caf25af3b
7
+ data.tar.gz: f16c92f5c15974e7bcf5baa447e49af716fbc1f0eb9659c8525384eb0bd15f5fff7b62edf2b5e778aeb32912eebd231dd0d0f3a64d641e21e6f23e7bd332385e
data/README.md CHANGED
@@ -1,15 +1,13 @@
1
- # Lucid::Machines
1
+ # LucidMachines
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/lucid/machines`. To experiment with that code, run `bin/console` for an interactive prompt.
4
3
 
5
- TODO: Delete this and the text above, and describe your gem
6
4
 
7
5
  ## Installation
8
6
 
9
7
  Add this line to your application's Gemfile:
10
8
 
11
9
  ```ruby
12
- gem 'lucid-machines'
10
+ gem 'lucidMachines'
13
11
  ```
14
12
 
15
13
  And then execute:
@@ -18,7 +16,7 @@ And then execute:
18
16
 
19
17
  Or install it yourself as:
20
18
 
21
- $ gem install lucid-machines
19
+ $ gem install lucidMachines
22
20
 
23
21
  ## Usage
24
22
 
@@ -32,8 +30,4 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
32
30
 
33
31
  ## Contributing
34
32
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/lucid-machines. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
36
-
37
- ## Code of Conduct
38
-
39
- Everyone interacting in the Lucid::Machines project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/lucid-machines/blob/master/CODE_OF_CONDUCT.md).
33
+ Bug reports and pull requests are welcome on Pole Aquinetic's Gitab at https://forge.pole-aquinetic.net/RealityTech/lucid-machines . This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
@@ -1,3 +1,9 @@
1
+ ###
2
+ # A chart is made of pages, blocks and links.
3
+ # Each block and links belong to a page.
4
+ # The links may or may not have blocks endpoints.
5
+ # The blocks may or may not have input / output blocks
6
+
1
7
  class Chart
2
8
  attr_reader :pages, :blocks, :links
3
9
 
@@ -7,6 +13,10 @@ class Chart
7
13
  @links = {}
8
14
  end
9
15
 
16
+ def to_s
17
+ puts "Chart, #{@pages.length} pages."
18
+ end
19
+
10
20
  def states
11
21
  @blocks.each_value.select{|b| b.is_state?}
12
22
  end
@@ -43,11 +53,9 @@ class Chart
43
53
  return out.first
44
54
  end
45
55
 
46
- # same for blocks
47
56
  def add_block(b) ; @blocks[b.id] = b; end
48
57
  def get_block(id); @blocks[id] ; end
49
58
 
50
- # same for links
51
59
  def add_link(l) ; @links[l.id] = l; end
52
60
  def get_link(id); @links[id] ; end
53
61
 
@@ -55,7 +63,6 @@ class Chart
55
63
  @blocks.has_key? id
56
64
  end
57
65
 
58
-
59
66
  # replace text with objects
60
67
  def set_pages
61
68
  @pages.each_value do |page|
@@ -81,6 +88,9 @@ class Chart
81
88
  end
82
89
  end
83
90
 
91
+
92
+ ## Warning, this logic should be elsewhere
93
+ ## too application - oriented
84
94
  def check_initial
85
95
  @blocks.each_value do |b|
86
96
  next unless b.has_links?
@@ -93,7 +103,7 @@ class Chart
93
103
  end
94
104
  end
95
105
 
96
-
106
+
97
107
  def subchart_for_page(page)
98
108
  chart = Chart.new
99
109
 
@@ -14,6 +14,16 @@ module LucidMachines
14
14
  export(chart, sheet)
15
15
  end
16
16
 
17
+ desc "list", "List the sheets in a CSV."
18
+ def list(csv_file)
19
+
20
+ chart = ChartLoader.new(csv_file).chart
21
+ chart.pages.each_value {|p| puts p.name.to_s }
22
+ # export_all chart
23
+ # export(chart, sheet)
24
+ end
25
+
26
+
17
27
  end
18
28
  end
19
29
 
@@ -1,10 +1,15 @@
1
+ ## Everything is an element.
2
+ ## (blocks, pages, and links)
3
+ ## Blocks are the default elements.
4
+
1
5
  class Element
2
6
  attr_reader :id, :page_id
3
7
  attr_reader :text, :type
4
8
 
5
9
  attr_reader :page
6
10
  attr_reader :initial, :hidden
7
-
11
+
12
+ ## Elements are created from an CSV entry
8
13
  def initialize(entry)
9
14
  @id = entry["Id"]
10
15
  @type = entry["Name"]
@@ -66,6 +71,9 @@ class Element
66
71
  end
67
72
  end
68
73
 
74
+ class Block < Element
75
+ end
76
+
69
77
  class Page < Element
70
78
  attr_reader :name
71
79
  attr_reader :blocks
@@ -1,4 +1,4 @@
1
- TextTypes = ["Text", "Process", "Terminator", "Decision"]
1
+ BlockTypes = ["Text", "Process", "Terminator", "Decision"]
2
2
  Containers = ["Swim Lane"]
3
3
  StructTypes = ["Page", "Line"] + Containers
4
4
  Links = ["Line"]
@@ -65,21 +65,21 @@ class ChartLoader
65
65
  end
66
66
  end
67
67
 
68
- def load_blocks
69
- # It is a text type
70
- blocks = @struct_data.select {|d| TextTypes.any? d["Name"] }
71
- blocks.map do |d|
72
- e = Element.new(d)
73
- @chart.add_block e
74
- d
75
- end
76
- end
68
+ # def load_blocks
69
+ # # It is a text type
70
+ # blocks = @struct_data.select {|d| BlockTypes.any? d["Name"] }
71
+ # blocks.map do |d|
72
+ # e = Block.new(d)
73
+ # @chart.add_block e
74
+ # d
75
+ # end
76
+ # end
77
77
 
78
78
  def load_all_blocks
79
79
  # It is a text type
80
80
  blocks = @struct_data
81
81
  blocks.map do |d|
82
- @chart.add_block(Element.new(d))
82
+ @chart.add_block(Block.new(d))
83
83
  d
84
84
  end
85
85
  end
@@ -1,3 +1,3 @@
1
1
  module LucidMachines
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lucidMachines
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Laviole
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-09-13 00:00:00.000000000 Z
11
+ date: 2019-09-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -104,7 +104,6 @@ extensions: []
104
104
  extra_rdoc_files: []
105
105
  files:
106
106
  - ".gitignore"
107
- - ".~lock.integration.csv#"
108
107
  - CODE_OF_CONDUCT.md
109
108
  - Gemfile
110
109
  - Gemfile.lock
@@ -160,7 +159,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
160
159
  - !ruby/object:Gem::Version
161
160
  version: '0'
162
161
  requirements: []
163
- rubygems_version: 3.0.3
162
+ rubygems_version: 3.0.6
164
163
  signing_key:
165
164
  specification_version: 4
166
165
  summary: Creates AASM state machines from LucidChart diagrams.
@@ -1 +0,0 @@
1
- ,jiii,jiii-mi,25.01.2019 22:33,file:///home/jiii/.config/libreoffice/4;