yuml 0.3.2 → 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/yuml.rb +11 -0
  3. data/lib/yuml/class.rb +4 -0
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1c6fef94c6462575c95cbfdbbbe293a1cd8d0dfd
4
- data.tar.gz: 9acbe49f4175cae128234b0b44c606aad4762f7b
3
+ metadata.gz: 34a697b99eb1a77a1601afa71051c254514ed67f
4
+ data.tar.gz: 86578c71f4369cc3d3a725ab00c2a6a0c7c991c0
5
5
  SHA512:
6
- metadata.gz: 2170fe261a250a4787591e1938eb141d99f13d184e748fa33877b282a31d25409597355ce681629fb22fd29d8b2c785d74d8a9b7334d626a86ac05bc25444d47
7
- data.tar.gz: 5579390bde42356b29a6c6cef2c552b20eda8be66f3aa542aa1be405fe6fb94193d1a37921553422cc961b65de8fea2bc19441459dcc43d5a8e9069c5a3d416e
6
+ metadata.gz: ccf54ee2096e03392be4617025b65269018e82be512e0d0d14f5e80d71089eb3b4b163cae15923fe1c6fdd4c21943d3a4e9e7f851c9838c561bad3a98f964bc6
7
+ data.tar.gz: 80f278c78ce1e56391fa1e116b5bd8dda2db94e5d49cb416232f75287f3e1a65ab79d0216b374433f4da9941ccf4f0aa50119c9609cbbc3456c4f9528cbd9679
data/lib/yuml.rb CHANGED
@@ -2,6 +2,7 @@
2
2
  require 'net/http'
3
3
  require 'yuml/class'
4
4
  require 'yuml/relationship'
5
+ require 'yuml/note'
5
6
 
6
7
  # A module to create a DSL for yuml.me
7
8
  module YUML
@@ -18,6 +19,7 @@ module YUML
18
19
  def generate(options)
19
20
  options = { file: '/tmp/yuml.pdf' }.merge(options)
20
21
  classes.clear
22
+ notes.clear
21
23
  yield self
22
24
  fetch_uml options[:file]
23
25
  end
@@ -29,16 +31,25 @@ module YUML
29
31
  yuml_class
30
32
  end
31
33
 
34
+ def attach_note(content, options = {})
35
+ notes << YUML::Note.create(content, options)
36
+ end
37
+
32
38
  private
33
39
 
34
40
  def classes
35
41
  @classes ||= []
36
42
  end
37
43
 
44
+ def notes
45
+ @notes ||= []
46
+ end
47
+
38
48
  def yuml
39
49
  uml = classes.map(&:to_s).join(',')
40
50
  relationships = classes.map(&:relationships).compact
41
51
  uml << ',' << relationships.join(',') unless relationships.empty?
52
+ uml << ',' << notes.join(',') unless notes.empty?
42
53
  URI.encode(uml, encodings)
43
54
  end
44
55
 
data/lib/yuml/class.rb CHANGED
@@ -46,6 +46,10 @@ module YUML
46
46
  @relationships << "[#{name}]#{relationship}[#{dest.name}]"
47
47
  end
48
48
 
49
+ def attach_note(content, options = {})
50
+ @relationships << "[#{name}]-#{YUML::Note.create(content, options)}"
51
+ end
52
+
49
53
  def to_s
50
54
  "[#{name}#{variables}#{methods}]"
51
55
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yuml
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Derek Stride