rpg-tools 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.textile +1 -1
- data/app/models/tools/check_roll.rb +7 -7
- data/config/locales/en.yml +1 -1
- data/lib/{rpg_tools.rb → rpg-tools.rb} +1 -1
- data/lib/rpg-tools/engine.rb +4 -0
- data/{rpg_tools.gemspec → rpg-tools.gemspec} +7 -7
- data/spec/dummy/config/application.rb +1 -1
- data/spec/models/tools/check_roll_spec.rb +1 -3
- metadata +20 -31
- data/lib/generators/rpg_tools/install_generator.rb +0 -21
- data/lib/generators/rpg_tools/templates/initializer.rb +0 -3
- data/lib/rpg_tools/engine.rb +0 -11
- data/spec/dummy/Gemfile +0 -6
data/README.textile
CHANGED
@@ -66,10 +66,10 @@ module Tools
|
|
66
66
|
|
67
67
|
# Returns the CheckRoll as a string. Example "2D4,1D6,1D20+3 must be greater or equal to 20."
|
68
68
|
def to_s
|
69
|
-
string = "#{@throw.to_s} #{I18n.t('
|
69
|
+
string = "#{@throw.to_s} #{I18n.t('rpg-tools.check_roll.must_be')} #{comparatives_text} #{@threshold}."
|
70
70
|
if @result
|
71
|
-
string << " #{I18n.t('
|
72
|
-
string << " #{@result[0] ? I18n.t('
|
71
|
+
string << " #{I18n.t('rpg-tools.check_roll.already_checked')}"
|
72
|
+
string << " #{@result[0] ? I18n.t('rpg-tools.check_roll.success') : I18n.t('rpg-tools.check_roll.failure')}"
|
73
73
|
string << " (#{@result[1][0]})."
|
74
74
|
end
|
75
75
|
string
|
@@ -95,13 +95,13 @@ module Tools
|
|
95
95
|
gtt = @greater_than_threshold
|
96
96
|
ett = @equal_to_threshold
|
97
97
|
if gtt and ett
|
98
|
-
return I18n.t '
|
98
|
+
return I18n.t 'rpg-tools.check_roll.greater_and_equal'
|
99
99
|
elsif gtt and !ett
|
100
|
-
return I18n.t '
|
100
|
+
return I18n.t 'rpg-tools.check_roll.greater'
|
101
101
|
elsif !gtt and !ett
|
102
|
-
return I18n.t '
|
102
|
+
return I18n.t 'rpg-tools.check_roll.less'
|
103
103
|
elsif !gtt and ett
|
104
|
-
return I18n.t '
|
104
|
+
return I18n.t 'rpg-tools.check_roll.less_and_equal'
|
105
105
|
end
|
106
106
|
end
|
107
107
|
end
|
data/config/locales/en.yml
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = "rpg-tools"
|
3
|
-
s.version = "0.2.
|
3
|
+
s.version = "0.2.2"
|
4
4
|
s.authors = ["Eduardo Casanova Cuesta"]
|
5
5
|
s.summary = "RPG Tools is a compilation of helpful tools when developing a Role Playing Game (RPG). For now the gem has three classes: Die, Throw and CheckRoll. "
|
6
6
|
s.description = "RPG Tools is a compilation of helpful tools when developing a Role Playing Game (RPG). For now the gem has three classes: Die, Throw and CheckRoll."
|
@@ -10,21 +10,21 @@ Gem::Specification.new do |s|
|
|
10
10
|
|
11
11
|
# Gem dependencies
|
12
12
|
#
|
13
|
-
s.add_runtime_dependency
|
13
|
+
s.add_runtime_dependency 'rails', '~> 3.0.0'
|
14
14
|
|
15
15
|
# Development Gem dependencies
|
16
16
|
#
|
17
17
|
# Testing database
|
18
|
-
s.add_development_dependency
|
18
|
+
s.add_development_dependency 'sqlite3-ruby'
|
19
19
|
# Debugging
|
20
20
|
if RUBY_VERSION < '1.9'
|
21
|
-
s.add_development_dependency
|
21
|
+
s.add_development_dependency 'ruby-debug'
|
22
22
|
end
|
23
23
|
# Specs
|
24
|
-
s.add_development_dependency
|
24
|
+
s.add_development_dependency 'rspec-rails'
|
25
25
|
# Fixtures
|
26
|
-
s.add_development_dependency
|
26
|
+
s.add_development_dependency 'factory_girl'
|
27
27
|
# Integration testing
|
28
|
-
s.add_development_dependency
|
28
|
+
s.add_development_dependency 'capybara'
|
29
29
|
end
|
30
30
|
|
@@ -1,7 +1,5 @@
|
|
1
1
|
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
|
2
2
|
|
3
|
-
|
4
|
-
|
5
3
|
describe Tools::CheckRoll do
|
6
4
|
describe "basic funtionality" do
|
7
5
|
before do
|
@@ -60,7 +58,7 @@ describe Tools::CheckRoll do
|
|
60
58
|
end
|
61
59
|
|
62
60
|
it "should turn a CheckRoll into a String" do
|
63
|
-
string = "#{@throw.to_s} #{I18n.t('
|
61
|
+
string = "#{@throw.to_s} #{I18n.t('rpg-tools.check_roll.must_be')} #{I18n.t('rpg-tools.check_roll.greater_and_equal')} #{@check_roll.threshold}."
|
64
62
|
assert @check_roll.to_s.eql? string
|
65
63
|
end
|
66
64
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rpg-tools
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 19
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
9
|
+
- 2
|
10
|
+
version: 0.2.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Eduardo Casanova Cuesta
|
@@ -53,14 +53,12 @@ dependencies:
|
|
53
53
|
requirement: &id003 !ruby/object:Gem::Requirement
|
54
54
|
none: false
|
55
55
|
requirements:
|
56
|
-
- -
|
56
|
+
- - ">="
|
57
57
|
- !ruby/object:Gem::Version
|
58
|
-
hash:
|
58
|
+
hash: 3
|
59
59
|
segments:
|
60
60
|
- 0
|
61
|
-
|
62
|
-
- 3
|
63
|
-
version: 0.10.3
|
61
|
+
version: "0"
|
64
62
|
type: :development
|
65
63
|
name: ruby-debug
|
66
64
|
version_requirements: *id003
|
@@ -69,14 +67,12 @@ dependencies:
|
|
69
67
|
requirement: &id004 !ruby/object:Gem::Requirement
|
70
68
|
none: false
|
71
69
|
requirements:
|
72
|
-
- -
|
70
|
+
- - ">="
|
73
71
|
- !ruby/object:Gem::Version
|
74
|
-
hash:
|
72
|
+
hash: 3
|
75
73
|
segments:
|
76
|
-
-
|
77
|
-
|
78
|
-
- 1
|
79
|
-
version: 2.6.1
|
74
|
+
- 0
|
75
|
+
version: "0"
|
80
76
|
type: :development
|
81
77
|
name: rspec-rails
|
82
78
|
version_requirements: *id004
|
@@ -85,14 +81,12 @@ dependencies:
|
|
85
81
|
requirement: &id005 !ruby/object:Gem::Requirement
|
86
82
|
none: false
|
87
83
|
requirements:
|
88
|
-
- -
|
84
|
+
- - ">="
|
89
85
|
- !ruby/object:Gem::Version
|
90
|
-
hash:
|
86
|
+
hash: 3
|
91
87
|
segments:
|
92
|
-
-
|
93
|
-
|
94
|
-
- 2
|
95
|
-
version: 1.3.2
|
88
|
+
- 0
|
89
|
+
version: "0"
|
96
90
|
type: :development
|
97
91
|
name: factory_girl
|
98
92
|
version_requirements: *id005
|
@@ -101,14 +95,12 @@ dependencies:
|
|
101
95
|
requirement: &id006 !ruby/object:Gem::Requirement
|
102
96
|
none: false
|
103
97
|
requirements:
|
104
|
-
- -
|
98
|
+
- - ">="
|
105
99
|
- !ruby/object:Gem::Version
|
106
|
-
hash:
|
100
|
+
hash: 3
|
107
101
|
segments:
|
108
|
-
- 1
|
109
102
|
- 0
|
110
|
-
|
111
|
-
version: 1.0.1
|
103
|
+
version: "0"
|
112
104
|
type: :development
|
113
105
|
name: capybara
|
114
106
|
version_requirements: *id006
|
@@ -133,12 +125,9 @@ files:
|
|
133
125
|
- app/models/tools/die.rb
|
134
126
|
- app/models/tools/throw.rb
|
135
127
|
- config/locales/en.yml
|
136
|
-
- lib/
|
137
|
-
- lib/
|
138
|
-
-
|
139
|
-
- lib/rpg_tools/engine.rb
|
140
|
-
- rpg_tools.gemspec
|
141
|
-
- spec/dummy/Gemfile
|
128
|
+
- lib/rpg-tools.rb
|
129
|
+
- lib/rpg-tools/engine.rb
|
130
|
+
- rpg-tools.gemspec
|
142
131
|
- spec/dummy/Rakefile
|
143
132
|
- spec/dummy/app/controllers/application_controller.rb
|
144
133
|
- spec/dummy/app/helpers/application_helper.rb
|
@@ -1,21 +0,0 @@
|
|
1
|
-
class RPG_Tools::InstallGenerator < Rails::Generators::Base #:nodoc:
|
2
|
-
include Rails::Generators::Migration
|
3
|
-
|
4
|
-
source_root File.expand_path('../templates', __FILE__)
|
5
|
-
|
6
|
-
require 'rails/generators/active_record'
|
7
|
-
|
8
|
-
def self.next_migration_number(dirname)
|
9
|
-
ActiveRecord::Generators::Base.next_migration_number(dirname)
|
10
|
-
end
|
11
|
-
|
12
|
-
def create_initializer_file
|
13
|
-
template 'initializer.rb', 'config/initializers/rpg_tools.rb'
|
14
|
-
end
|
15
|
-
|
16
|
-
def create_migration_file
|
17
|
-
require 'rake'
|
18
|
-
Rails.application.load_tasks
|
19
|
-
Rake::Task['rpg_tools_engine:install:migrations'].invoke
|
20
|
-
end
|
21
|
-
end
|
data/lib/rpg_tools/engine.rb
DELETED