yumlcmd 0.0.3 → 0.0.4

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 (4) hide show
  1. data/VERSION +1 -1
  2. data/lib/yumlcmd.rb +13 -4
  3. data/yumlcmd.gemspec +7 -6
  4. metadata +25 -9
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.3
1
+ 0.0.4
@@ -4,9 +4,14 @@ require "optparse"
4
4
  class YumlCmd
5
5
 
6
6
  def YumlCmd.generate(args)
7
+ # Defaults
7
8
  ext = "png"
8
- input = output = nil
9
+ input = nil
10
+ output = nil
9
11
  type = "/scruffy"
12
+ diagramtype = "class"
13
+
14
+ # Option parser
10
15
  opts = OptionParser.new do |o|
11
16
  o.banner = "Usage: #{File.basename($0)} [options]"
12
17
  o.on('-f', '--file FILENAME', 'File containing yuml.me diagram.') do |filename|
@@ -20,7 +25,10 @@ class YumlCmd
20
25
  end
21
26
  o.on('-n', '--name OUTPUT', 'Output filename') do |name|
22
27
  output = name
23
- end
28
+ end
29
+ o.on('-d', '--diagram DIAGRAM', 'Diagram type: class, activity, usecase') do |diagram|
30
+ diagramtype = diagram
31
+ end
24
32
  o.on_tail('-h', '--help', 'Display this help and exit') do
25
33
  puts opts
26
34
  exit
@@ -28,12 +36,13 @@ class YumlCmd
28
36
  end
29
37
  opts.parse!(args)
30
38
 
39
+ # Fetch the image
31
40
  lines = IO.readlines(input).collect!{|l| l.gsub("\n", "")}.reject{|l| l =~ /#/}
32
41
  output = output || "#{input.gsub(".", "-")}"
33
42
  writer = open("#{output}.#{ext}", "wb")
34
43
 
35
44
  res = Net::HTTP.start("yuml.me", 80) {|http|
36
- http.get(URI.escape("/diagram#{type}/class/#{lines.join(",")}"))
45
+ http.get(URI.escape("/diagram#{type}/#{diagramtype}/#{lines.join(",")}"))
37
46
  }
38
47
  writer.write(res.body)
39
48
  writer.close
@@ -43,4 +52,4 @@ end
43
52
 
44
53
  if $0 == __FILE__
45
54
  YumlCmd.generate(ARGV)
46
- end
55
+ end
@@ -1,15 +1,15 @@
1
1
  # Generated by jeweler
2
- # DO NOT EDIT THIS FILE
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run `rake gemspec`
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
4
  # -*- encoding: utf-8 -*-
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{yumlcmd}
8
- s.version = "0.0.3"
8
+ s.version = "0.0.4"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["atog"]
12
- s.date = %q{2009-10-14}
12
+ s.date = %q{2010-09-30}
13
13
  s.default_executable = %q{yumlme}
14
14
  s.description = %q{A commandline interface to generate UML diagrams with http://yuml.me}
15
15
  s.email = %q{koen@atog.be}
@@ -34,7 +34,7 @@ Gem::Specification.new do |s|
34
34
  s.homepage = %q{http://github.com/atog/yumlcmd}
35
35
  s.rdoc_options = ["--charset=UTF-8"]
36
36
  s.require_paths = ["lib"]
37
- s.rubygems_version = %q{1.3.5}
37
+ s.rubygems_version = %q{1.3.7}
38
38
  s.summary = %q{A commandline interface to generate UML diagrams with http://yuml.me}
39
39
  s.test_files = [
40
40
  "test/test_helper.rb",
@@ -45,7 +45,7 @@ Gem::Specification.new do |s|
45
45
  current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
46
46
  s.specification_version = 3
47
47
 
48
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
48
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
49
49
  s.add_development_dependency(%q<thoughtbot-shoulda>, [">= 0"])
50
50
  else
51
51
  s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
@@ -54,3 +54,4 @@ Gem::Specification.new do |s|
54
54
  s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
55
55
  end
56
56
  end
57
+
metadata CHANGED
@@ -1,7 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yumlcmd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ hash: 23
5
+ prerelease: false
6
+ segments:
7
+ - 0
8
+ - 0
9
+ - 4
10
+ version: 0.0.4
5
11
  platform: ruby
6
12
  authors:
7
13
  - atog
@@ -9,19 +15,23 @@ autorequire:
9
15
  bindir: bin
10
16
  cert_chain: []
11
17
 
12
- date: 2009-10-14 00:00:00 +02:00
18
+ date: 2010-09-30 00:00:00 +02:00
13
19
  default_executable: yumlme
14
20
  dependencies:
15
21
  - !ruby/object:Gem::Dependency
16
22
  name: thoughtbot-shoulda
17
- type: :development
18
- version_requirement:
19
- version_requirements: !ruby/object:Gem::Requirement
23
+ prerelease: false
24
+ requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
20
26
  requirements:
21
27
  - - ">="
22
28
  - !ruby/object:Gem::Version
29
+ hash: 3
30
+ segments:
31
+ - 0
23
32
  version: "0"
24
- version:
33
+ type: :development
34
+ version_requirements: *id001
25
35
  description: A commandline interface to generate UML diagrams with http://yuml.me
26
36
  email: koen@atog.be
27
37
  executables:
@@ -53,21 +63,27 @@ rdoc_options:
53
63
  require_paths:
54
64
  - lib
55
65
  required_ruby_version: !ruby/object:Gem::Requirement
66
+ none: false
56
67
  requirements:
57
68
  - - ">="
58
69
  - !ruby/object:Gem::Version
70
+ hash: 3
71
+ segments:
72
+ - 0
59
73
  version: "0"
60
- version:
61
74
  required_rubygems_version: !ruby/object:Gem::Requirement
75
+ none: false
62
76
  requirements:
63
77
  - - ">="
64
78
  - !ruby/object:Gem::Version
79
+ hash: 3
80
+ segments:
81
+ - 0
65
82
  version: "0"
66
- version:
67
83
  requirements: []
68
84
 
69
85
  rubyforge_project:
70
- rubygems_version: 1.3.5
86
+ rubygems_version: 1.3.7
71
87
  signing_key:
72
88
  specification_version: 3
73
89
  summary: A commandline interface to generate UML diagrams with http://yuml.me