draw_uml 0.0.1

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 32353c04331e0f0f460b83fa73745bb54d04354b
4
+ data.tar.gz: 989ee3f1245ebd68aebb132158b4764281e57236
5
+ SHA512:
6
+ metadata.gz: bf9a6ac93c4e6b98892b607c7e0e3ec310910894f6a5bbfd61fed060d1c850e95fd123d7ce2f767511be1e6a891b4d07a147689217aa4304527821256326748b
7
+ data.tar.gz: 0de6e7790525f79298888089a9019386ceafad2c35760dd8588906f991d3c125d7ef61e65db7d2cc71947d6fe20d63e759e1f42cf84a05b94f159b6a44cdd434
data/.gitignore ADDED
@@ -0,0 +1,5 @@
1
+ .bundle
2
+ pkg
3
+ public
4
+ tmp
5
+ Gemfile.lock
data/.travis.yml ADDED
@@ -0,0 +1,3 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.0.0
data/Gemfile ADDED
@@ -0,0 +1,8 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in draw_uml.gemspec
4
+ gemspec
5
+
6
+ group :test do
7
+ gem 'rspec'
8
+ end
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 ogom
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,33 @@
1
+ # Draw UML
2
+
3
+ [![Gem Version](https://badge.fury.io/rb/draw_uml.png)](https://rubygems.org/gems/draw_uml) [![Build Status](https://travis-ci.org/ogom/draw_uml.png?branch=master)](https://travis-ci.org/ogom/draw_uml)
4
+
5
+ TODO: Write a gem description
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'draw_uml'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install draw_uml
22
+
23
+ ## Usage
24
+
25
+ TODO: Write usage instructions here
26
+
27
+ ## Contributing
28
+
29
+ 1. Fork it ( https://github.com/[my-github-username]/draw_uml/fork )
30
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
31
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
32
+ 4. Push to the branch (`git push origin my-new-feature`)
33
+ 5. Create a new Pull Request
data/Rakefile ADDED
@@ -0,0 +1,9 @@
1
+ require 'bundler/gem_tasks'
2
+
3
+ require 'rspec/core/rake_task'
4
+ RSpec::Core::RakeTask.new(:spec) do |task|
5
+ task.rspec_opts = ['--color', '--format', 'doc']
6
+ end
7
+
8
+ task test: :spec
9
+ task default: :spec
data/bin/draw_uml ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require_relative '../lib/draw_uml'
4
+
5
+ DrawUml::Diagram.create
data/config.ru ADDED
@@ -0,0 +1,3 @@
1
+ require_relative './lib/draw_uml'
2
+ use Rack::Static, :urls => ['/images'], :root => "public"
3
+ run DrawUml::Engine
@@ -0,0 +1,7 @@
1
+ @startuml
2
+ Alice -> Bob: Authentication Request
3
+ Bob --> Alice: Authentication Response
4
+
5
+ Alice -> Bob: Another authentication Request
6
+ Alice <-- Bob: another authentication Response
7
+ @enduml
data/draw_uml.gemspec ADDED
@@ -0,0 +1,25 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'draw_uml/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "draw_uml"
8
+ spec.version = DrawUml::VERSION
9
+ spec.authors = ["ogom"]
10
+ spec.email = ["ogom@hotmail.co.jp"]
11
+ spec.summary = %q{Drawing the Unified Modeling Language.}
12
+ spec.description = %q{Drawing the Unified Modeling Language of Rack.}
13
+ spec.homepage = "http://ogom.github.io/draw_uml"
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files -z`.split("\x0")
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_dependency 'rack'
22
+
23
+ spec.add_development_dependency 'bundler'
24
+ spec.add_development_dependency 'rake'
25
+ end
@@ -0,0 +1,13 @@
1
+ require 'open3'
2
+
3
+ module DrawUml
4
+ class Diagram
5
+ def self.create
6
+ file = File.read(File.expand_path('sequence.md', './doc/uml'))
7
+ path = File.expand_path('sequence.png', './public/images/draw-uml')
8
+
9
+ cmd = "plantuml -pipe > #{path}"
10
+ stdout, status = Open3.capture2(cmd, stdin_data: file)
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,22 @@
1
+ require 'rack'
2
+ require 'erb'
3
+
4
+ module DrawUml
5
+ class Engine
6
+ class << self
7
+ def call(env)
8
+ DrawUml::Diagram.create
9
+
10
+ status = 200
11
+ headers = {'Content-Type' => 'text/html'}
12
+
13
+ file = File.read(File.expand_path('application.html.erb', './lib/templates/layouts'))
14
+ path = File.join('images', 'draw-uml', 'sequence.png')
15
+ erb = ERB.new(file)
16
+ body = erb.result(binding)
17
+
18
+ [status, headers, [body]]
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,3 @@
1
+ module DrawUml
2
+ VERSION = '0.0.1'
3
+ end
data/lib/draw_uml.rb ADDED
@@ -0,0 +1,3 @@
1
+ require_relative 'draw_uml/version'
2
+ require_relative 'draw_uml/engine'
3
+ require_relative 'draw_uml/diagram'
@@ -0,0 +1,11 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>UML</title>
5
+ </head>
6
+ <body>
7
+
8
+ <img src=<%= path %>>
9
+
10
+ </body>
11
+ </html>
@@ -0,0 +1,9 @@
1
+ require 'spec_helper'
2
+
3
+ describe DrawUml do
4
+ describe "VERSION" do
5
+ it "DrawUml::VERSION" do
6
+ expect(DrawUml::VERSION).to eq(DrawUml::VERSION)
7
+ end
8
+ end
9
+ end
@@ -0,0 +1 @@
1
+ require 'draw_uml'
metadata ADDED
@@ -0,0 +1,106 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: draw_uml
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - ogom
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-09-07 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rack
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ description: Drawing the Unified Modeling Language of Rack.
56
+ email:
57
+ - ogom@hotmail.co.jp
58
+ executables:
59
+ - draw_uml
60
+ extensions: []
61
+ extra_rdoc_files: []
62
+ files:
63
+ - ".gitignore"
64
+ - ".travis.yml"
65
+ - Gemfile
66
+ - LICENSE.txt
67
+ - README.md
68
+ - Rakefile
69
+ - bin/draw_uml
70
+ - config.ru
71
+ - doc/uml/sequence.md
72
+ - draw_uml.gemspec
73
+ - lib/draw_uml.rb
74
+ - lib/draw_uml/diagram.rb
75
+ - lib/draw_uml/engine.rb
76
+ - lib/draw_uml/version.rb
77
+ - lib/templates/layouts/application.html.erb
78
+ - spec/lib/version_spec.rb
79
+ - spec/spec_helper.rb
80
+ homepage: http://ogom.github.io/draw_uml
81
+ licenses:
82
+ - MIT
83
+ metadata: {}
84
+ post_install_message:
85
+ rdoc_options: []
86
+ require_paths:
87
+ - lib
88
+ required_ruby_version: !ruby/object:Gem::Requirement
89
+ requirements:
90
+ - - ">="
91
+ - !ruby/object:Gem::Version
92
+ version: '0'
93
+ required_rubygems_version: !ruby/object:Gem::Requirement
94
+ requirements:
95
+ - - ">="
96
+ - !ruby/object:Gem::Version
97
+ version: '0'
98
+ requirements: []
99
+ rubyforge_project:
100
+ rubygems_version: 2.2.2
101
+ signing_key:
102
+ specification_version: 4
103
+ summary: Drawing the Unified Modeling Language.
104
+ test_files:
105
+ - spec/lib/version_spec.rb
106
+ - spec/spec_helper.rb