peto 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -10,6 +10,8 @@ begin
10
10
  gem.email = "toshi.hirooka@gmail.com"
11
11
  gem.homepage = "http://github.com/tosik/peto"
12
12
  gem.authors = ["Toshiyuki Hirooka"]
13
+ gem.add_dependency "term-ansicolor", ">= 0"
14
+ gem.add_dependency "activesupport", ">= 0"
13
15
  gem.add_development_dependency "thoughtbot-shoulda", ">= 0"
14
16
  gem.files.exclude "examples"
15
17
  # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.2
1
+ 0.2.3
@@ -1,4 +1,4 @@
1
- Hoge::Application.configure do
1
+ RailsApp::Application.configure do
2
2
  # Settings specified here will take precedence over those in config/environment.rb
3
3
 
4
4
  # In the development environment your application's code is reloaded on
@@ -1,4 +1,4 @@
1
- Hoge::Application.configure do
1
+ RailsApp::Application.configure do
2
2
  # Settings specified here will take precedence over those in config/environment.rb
3
3
 
4
4
  # The production environment is meant for finished, "live" apps.
@@ -0,0 +1,27 @@
1
+ require "peto/mixin/peto_class"
2
+
3
+ module Peto
4
+ class Aho
5
+ include PetoClass
6
+ def initialize(args={})
7
+ @name = nil
8
+
9
+ set_by_hash(args)
10
+ raise_errors unless valid?
11
+ end
12
+
13
+ attr_reader :name
14
+
15
+ def members
16
+ [:name]
17
+ end
18
+
19
+ def types
20
+ {:name => String}
21
+ end
22
+
23
+ def arrays
24
+ {}
25
+ end
26
+ end
27
+ end
@@ -4,20 +4,20 @@ module Peto
4
4
  class Animal
5
5
  include PetoClass
6
6
  def initialize(args={})
7
- @name = nil
7
+ @nme = nil
8
8
 
9
9
  set_by_hash(args)
10
10
  raise_errors unless valid?
11
11
  end
12
12
 
13
- attr_reader :name
13
+ attr_reader :nme
14
14
 
15
15
  def members
16
- [:name]
16
+ [:nme]
17
17
  end
18
18
 
19
19
  def types
20
- {:name => String}
20
+ {:nme => String}
21
21
  end
22
22
 
23
23
  def arrays
@@ -0,0 +1,27 @@
1
+ require "peto/mixin/peto_class"
2
+
3
+ module Peto
4
+ class Iasdaho
5
+ include PetoClass
6
+ def initialize(args={})
7
+ @name = nil
8
+
9
+ set_by_hash(args)
10
+ raise_errors unless valid?
11
+ end
12
+
13
+ attr_reader :name
14
+
15
+ def members
16
+ [:name]
17
+ end
18
+
19
+ def types
20
+ {:name => String}
21
+ end
22
+
23
+ def arrays
24
+ {}
25
+ end
26
+ end
27
+ end
data/lib/peto/master.rb CHANGED
@@ -1,6 +1,11 @@
1
1
  require "pathname"
2
2
  require "yaml"
3
3
  require "peto/generator"
4
+ require "term/ansicolor"
5
+
6
+ class String
7
+ include Term::ANSIColor
8
+ end
4
9
 
5
10
  module Peto
6
11
  TEMPLATE_DIR = File::dirname(File::expand_path( __FILE__ )) + "/../templates"
@@ -28,14 +33,14 @@ module Peto
28
33
  print " "
29
34
  if File.exist?(filepath)
30
35
  if File.read(filepath) == content
31
- print "identical"
36
+ print "identical".blue.bold
32
37
  else
33
- print "update "
38
+ print "update ".white.bold
34
39
  end
35
40
  else
36
- print "create "
41
+ print "create ".green.bold
37
42
  end
38
- print " "
43
+ print " "
39
44
 
40
45
  open(filepath, "w") do |file|
41
46
  file.write(content)
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 2
8
- - 2
9
- version: 0.2.2
8
+ - 3
9
+ version: 0.2.3
10
10
  platform: ruby
11
11
  authors:
12
12
  - Toshiyuki Hirooka
@@ -18,7 +18,7 @@ date: 2010-11-03 00:00:00 +09:00
18
18
  default_executable: peto
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
- name: thoughtbot-shoulda
21
+ name: term-ansicolor
22
22
  prerelease: false
23
23
  requirement: &id001 !ruby/object:Gem::Requirement
24
24
  none: false
@@ -28,8 +28,34 @@ dependencies:
28
28
  segments:
29
29
  - 0
30
30
  version: "0"
31
- type: :development
31
+ type: :runtime
32
32
  version_requirements: *id001
33
+ - !ruby/object:Gem::Dependency
34
+ name: activesupport
35
+ prerelease: false
36
+ requirement: &id002 !ruby/object:Gem::Requirement
37
+ none: false
38
+ requirements:
39
+ - - ">="
40
+ - !ruby/object:Gem::Version
41
+ segments:
42
+ - 0
43
+ version: "0"
44
+ type: :runtime
45
+ version_requirements: *id002
46
+ - !ruby/object:Gem::Dependency
47
+ name: thoughtbot-shoulda
48
+ prerelease: false
49
+ requirement: &id003 !ruby/object:Gem::Requirement
50
+ none: false
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ segments:
55
+ - 0
56
+ version: "0"
57
+ type: :development
58
+ version_requirements: *id003
33
59
  description: contract code generator for multi-language
34
60
  email: toshi.hirooka@gmail.com
35
61
  executables:
@@ -85,8 +111,10 @@ files:
85
111
  - examples/rails_app/contracts/animal.rb
86
112
  - examples/rails_app/contracts/user.rb
87
113
  - examples/rails_app/contracts/generated/animal.rb
114
+ - examples/rails_app/contracts/generated/aho.rb
88
115
  - examples/rails_app/contracts/generated/user.rb
89
116
  - examples/rails_app/contracts/generated/foo.rb
117
+ - examples/rails_app/contracts/generated/iasdaho.rb
90
118
  - examples/rails_app/contracts/foo.rb
91
119
  has_rdoc: true
92
120
  homepage: http://github.com/tosik/peto
@@ -148,6 +176,8 @@ test_files:
148
176
  - examples/rails_app/contracts/animal.rb
149
177
  - examples/rails_app/contracts/user.rb
150
178
  - examples/rails_app/contracts/generated/animal.rb
179
+ - examples/rails_app/contracts/generated/aho.rb
151
180
  - examples/rails_app/contracts/generated/user.rb
152
181
  - examples/rails_app/contracts/generated/foo.rb
182
+ - examples/rails_app/contracts/generated/iasdaho.rb
153
183
  - examples/rails_app/contracts/foo.rb