rasem 0.5.0 → 0.5.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.
- data/Rakefile +0 -1
- data/VERSION +1 -1
- data/bin/rasem +1 -22
- data/lib/rasem.rb +1 -0
- data/lib/rasem/application.rb +30 -0
- metadata +4 -3
data/Rakefile
CHANGED
@@ -22,7 +22,6 @@ Jeweler::Tasks.new do |gem|
|
|
22
22
|
DESCRIPTION
|
23
23
|
gem.email = "eldawy@cs.umn.edu"
|
24
24
|
gem.authors = ["Ahmed Eldawy"]
|
25
|
-
gem.executables = ["rasem"]
|
26
25
|
# Include your dependencies below. Runtime dependencies are required when using your gem,
|
27
26
|
# and development dependencies are only needed for development (ie running rake tasks, tests, etc)
|
28
27
|
# gem.add_runtime_dependency 'jabber4r', '> 0.1'
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.5.
|
1
|
+
0.5.1
|
data/bin/rasem
CHANGED
@@ -3,26 +3,5 @@ rasem_dir = File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib'))
|
|
3
3
|
$LOAD_PATH.unshift(rasem_dir) unless $LOAD_PATH.include?(rasem_dir)
|
4
4
|
require 'rasem'
|
5
5
|
|
6
|
-
|
7
|
-
source_files = Dir.glob(File.expand_path("*.rasem"))
|
8
|
-
else
|
9
|
-
source_files = ARGV
|
10
|
-
end
|
6
|
+
exit Rasem::Application.run!(*ARGV)
|
11
7
|
|
12
|
-
if source_files.empty?
|
13
|
-
puts "No input files"
|
14
|
-
end
|
15
|
-
|
16
|
-
for source_file in source_files
|
17
|
-
puts "Source file #{source_file}"
|
18
|
-
if source_file =~ /\.rasem$/
|
19
|
-
svg_file = source_file.sub(/\.rasem$/, '.svg')
|
20
|
-
else
|
21
|
-
svg_file = source_file + ".svg"
|
22
|
-
end
|
23
|
-
File.open(svg_file, "w") do |f|
|
24
|
-
Rasem::SVGImage.new(f, 100, 100) do
|
25
|
-
eval(File.read(source_file), binding)
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
data/lib/rasem.rb
CHANGED
@@ -0,0 +1,30 @@
|
|
1
|
+
class Rasem::Application
|
2
|
+
def self.run!(*argv)
|
3
|
+
if argv.empty?
|
4
|
+
source_files = Dir.glob(File.expand_path("*.rasem"))
|
5
|
+
else
|
6
|
+
source_files = argv
|
7
|
+
end
|
8
|
+
|
9
|
+
if source_files.empty?
|
10
|
+
puts "No input files"
|
11
|
+
return 1
|
12
|
+
end
|
13
|
+
|
14
|
+
for source_file in source_files
|
15
|
+
puts "Source file #{source_file}"
|
16
|
+
if source_file =~ /\.rasem$/
|
17
|
+
svg_file = source_file.sub(/\.rasem$/, '.svg')
|
18
|
+
else
|
19
|
+
svg_file = source_file + ".svg"
|
20
|
+
end
|
21
|
+
File.open(svg_file, "w") do |f|
|
22
|
+
Rasem::SVGImage.new(f, 100, 100) do
|
23
|
+
eval(File.read(source_file), binding)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
return 0
|
29
|
+
end
|
30
|
+
end
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 5
|
8
|
-
-
|
9
|
-
version: 0.5.
|
8
|
+
- 1
|
9
|
+
version: 0.5.1
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Ahmed Eldawy
|
@@ -94,6 +94,7 @@ files:
|
|
94
94
|
- VERSION
|
95
95
|
- bin/rasem
|
96
96
|
- lib/rasem.rb
|
97
|
+
- lib/rasem/application.rb
|
97
98
|
- lib/rasem/svg_image.rb
|
98
99
|
- spec/rasem_spec.rb
|
99
100
|
- spec/spec_helper.rb
|
@@ -111,7 +112,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
111
112
|
requirements:
|
112
113
|
- - ">="
|
113
114
|
- !ruby/object:Gem::Version
|
114
|
-
hash: -
|
115
|
+
hash: -2955251890705000744
|
115
116
|
segments:
|
116
117
|
- 0
|
117
118
|
version: "0"
|