diamond-lang 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/Gemfile.lock +15 -17
- data/README.md +1 -1
- data/Rakefile +12 -6
- data/VERSION +1 -1
- data/diamond-lang.gemspec +14 -9
- data/examples/conveyor.rb +23 -0
- data/lib/diamond-lang/helpers/entity.rb +1 -1
- data/lib/diamond-lang/helpers/target_selector.rb +2 -3
- data/lib/diamond-lang/one_command.rb +32 -2
- data/spec/errors/invalid_axis_spec.rb +11 -0
- data/spec/errors/invalid_coordinate_value_spec.rb +11 -0
- data/spec/errors/relative_cordinate_converted_to_argument_spec.rb +10 -0
- data/spec/errors/too_small_spec.rb +10 -0
- data/{test → spec}/helper.rb +8 -5
- data/spec/helpers/block_spec.rb +43 -0
- data/spec/index.html +615 -0
- metadata +24 -19
- data/lib/diamond-lang/minecraft/commands/say.rb +0 -14
- data/test/test_diamond-lang.rb +0 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4f4dee69b65d4818e84f2fb19a58888c5428cd6b
|
4
|
+
data.tar.gz: d79712b1c3153e6dbe6b5ca0f23647d86409cab8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d9d89324c1f3b85e92f545bf65712acb5799aa6019958bff534000adb84259d7a5c035c47db2d217b31942ed344096fe46f78c74804f5fed261697d3150914c3
|
7
|
+
data.tar.gz: 3b08847a05ff5af58cfa980ccfa3e7929a7cb50b60467b38d724d906dc7bdfab221830541bddcea6bccc442a1b6760e5b05613df2f995262ab869229da8c91de
|
data/Gemfile
CHANGED
@@ -6,11 +6,11 @@ source "http://rubygems.org"
|
|
6
6
|
# Add dependencies to develop your gem here.
|
7
7
|
# Include everything needed to run rake, tests, features, etc.
|
8
8
|
group :development do
|
9
|
-
gem "shoulda", "~> 3.5"
|
10
9
|
gem "rdoc", "~> 3.12"
|
11
10
|
gem "bundler", "~> 1.0"
|
12
11
|
gem "jeweler", "~> 2.0"
|
13
12
|
gem "simplecov", "~> 0.11"
|
13
|
+
gem "rspec", "~> 3.4"
|
14
14
|
|
15
15
|
gem "pry", "~> 0.10"
|
16
16
|
gem "pry-doc", "~> 0.8"
|
data/Gemfile.lock
CHANGED
@@ -1,18 +1,13 @@
|
|
1
1
|
GEM
|
2
2
|
remote: http://rubygems.org/
|
3
3
|
specs:
|
4
|
-
activesupport (4.2.5)
|
5
|
-
i18n (~> 0.7)
|
6
|
-
json (~> 1.7, >= 1.7.7)
|
7
|
-
minitest (~> 5.1)
|
8
|
-
thread_safe (~> 0.3, >= 0.3.4)
|
9
|
-
tzinfo (~> 1.1)
|
10
4
|
addressable (2.4.0)
|
11
5
|
builder (3.2.2)
|
12
6
|
byebug (8.2.1)
|
13
7
|
coderay (1.1.0)
|
14
8
|
descendants_tracker (0.0.4)
|
15
9
|
thread_safe (~> 0.3, >= 0.3.1)
|
10
|
+
diff-lcs (1.2.5)
|
16
11
|
docile (1.1.5)
|
17
12
|
faraday (0.9.2)
|
18
13
|
multipart-post (>= 1.2, < 3)
|
@@ -26,7 +21,6 @@ GEM
|
|
26
21
|
oauth2
|
27
22
|
hashie (3.4.3)
|
28
23
|
highline (1.7.8)
|
29
|
-
i18n (0.7.0)
|
30
24
|
jeweler (2.0.1)
|
31
25
|
builder
|
32
26
|
bundler (>= 1.0)
|
@@ -40,7 +34,6 @@ GEM
|
|
40
34
|
jwt (1.5.2)
|
41
35
|
method_source (0.8.2)
|
42
36
|
mini_portile2 (2.0.0)
|
43
|
-
minitest (5.8.3)
|
44
37
|
multi_json (1.11.2)
|
45
38
|
multi_xml (0.5.5)
|
46
39
|
multipart-post (2.0.0)
|
@@ -64,12 +57,19 @@ GEM
|
|
64
57
|
rdoc (3.12.2)
|
65
58
|
json (~> 1.4)
|
66
59
|
require_all (1.3.3)
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
60
|
+
rspec (3.4.0)
|
61
|
+
rspec-core (~> 3.4.0)
|
62
|
+
rspec-expectations (~> 3.4.0)
|
63
|
+
rspec-mocks (~> 3.4.0)
|
64
|
+
rspec-core (3.4.1)
|
65
|
+
rspec-support (~> 3.4.0)
|
66
|
+
rspec-expectations (3.4.0)
|
67
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
68
|
+
rspec-support (~> 3.4.0)
|
69
|
+
rspec-mocks (3.4.0)
|
70
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
71
|
+
rspec-support (~> 3.4.0)
|
72
|
+
rspec-support (3.4.1)
|
73
73
|
simplecov (0.11.1)
|
74
74
|
docile (~> 1.1.0)
|
75
75
|
json (~> 1.8)
|
@@ -77,8 +77,6 @@ GEM
|
|
77
77
|
simplecov-html (0.10.0)
|
78
78
|
slop (3.6.0)
|
79
79
|
thread_safe (0.3.5)
|
80
|
-
tzinfo (1.2.2)
|
81
|
-
thread_safe (~> 0.1)
|
82
80
|
yard (0.8.7.6)
|
83
81
|
|
84
82
|
PLATFORMS
|
@@ -92,7 +90,7 @@ DEPENDENCIES
|
|
92
90
|
pry-doc (~> 0.8)
|
93
91
|
rdoc (~> 3.12)
|
94
92
|
require_all (~> 1.3)
|
95
|
-
|
93
|
+
rspec (~> 3.4)
|
96
94
|
simplecov (~> 0.11)
|
97
95
|
|
98
96
|
BUNDLED WITH
|
data/README.md
CHANGED
@@ -25,7 +25,7 @@ Go to <http://rubyinstaller.org> and download the correct version of Ruby.
|
|
25
25
|
You should have [ruby gems][gems], which allows you to download gems. To install diamond lang, type the following in your terminal:
|
26
26
|
|
27
27
|
~~~sh
|
28
|
-
gem
|
28
|
+
gem diamond-lang
|
29
29
|
~~~
|
30
30
|
|
31
31
|
Now, you're good to go.
|
data/Rakefile
CHANGED
@@ -25,17 +25,23 @@ Jeweler::Tasks.new do |gem|
|
|
25
25
|
end
|
26
26
|
Jeweler::RubygemsDotOrgTasks.new
|
27
27
|
|
28
|
-
require '
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
28
|
+
require 'rspec/core'
|
29
|
+
require 'rspec/core/rake_task'
|
30
|
+
RSpec::Core::RakeTask.new(:spec) do |spec|
|
31
|
+
spec.rspec_opts = '--format documentation'
|
32
|
+
spec.pattern = FileList['spec/**/*_spec.rb']
|
33
|
+
end
|
34
|
+
|
35
|
+
RSpec::Core::RakeTask.new(:webspec) do |spec|
|
36
|
+
spec.rspec_opts = '--format html --out spec/index.html'
|
37
|
+
spec.pattern = FileList['spec/**/*_spec.rb']
|
38
|
+
`open spec/index.html`
|
33
39
|
end
|
34
40
|
|
35
41
|
desc "Code coverage detail"
|
36
42
|
task :simplecov do
|
37
43
|
ENV['COVERAGE'] = "true"
|
38
|
-
Rake::Task['
|
44
|
+
Rake::Task['spec'].execute
|
39
45
|
end
|
40
46
|
|
41
47
|
task :default => :test
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.1.0
|
data/diamond-lang.gemspec
CHANGED
@@ -2,16 +2,16 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: diamond-lang 1.
|
5
|
+
# stub: diamond-lang 1.1.0 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "diamond-lang"
|
9
|
-
s.version = "1.
|
9
|
+
s.version = "1.1.0"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib"]
|
13
13
|
s.authors = ["Ben (@penne12_)"]
|
14
|
-
s.date = "2015-12-
|
14
|
+
s.date = "2015-12-29"
|
15
15
|
s.description = "Making Minecraft 1 Command Creations with ruby. It's as easy as `c.say 123`"
|
16
16
|
s.email = "ben@bensites.com"
|
17
17
|
s.extra_rdoc_files = [
|
@@ -27,6 +27,7 @@ Gem::Specification.new do |s|
|
|
27
27
|
"Rakefile",
|
28
28
|
"VERSION",
|
29
29
|
"diamond-lang.gemspec",
|
30
|
+
"examples/conveyor.rb",
|
30
31
|
"examples/hello_world.rb",
|
31
32
|
"lib/diamond-lang.rb",
|
32
33
|
"lib/diamond-lang/command_chain.rb",
|
@@ -44,10 +45,14 @@ Gem::Specification.new do |s|
|
|
44
45
|
"lib/diamond-lang/helpers/errors/too_small.rb",
|
45
46
|
"lib/diamond-lang/helpers/falling_sand.rb",
|
46
47
|
"lib/diamond-lang/helpers/target_selector.rb",
|
47
|
-
"lib/diamond-lang/minecraft/commands/say.rb",
|
48
48
|
"lib/diamond-lang/one_command.rb",
|
49
|
-
"
|
50
|
-
"
|
49
|
+
"spec/errors/invalid_axis_spec.rb",
|
50
|
+
"spec/errors/invalid_coordinate_value_spec.rb",
|
51
|
+
"spec/errors/relative_cordinate_converted_to_argument_spec.rb",
|
52
|
+
"spec/errors/too_small_spec.rb",
|
53
|
+
"spec/helper.rb",
|
54
|
+
"spec/helpers/block_spec.rb",
|
55
|
+
"spec/index.html"
|
51
56
|
]
|
52
57
|
s.homepage = "http://bensites.com/diamond-lang/"
|
53
58
|
s.licenses = ["MIT"]
|
@@ -59,32 +64,32 @@ Gem::Specification.new do |s|
|
|
59
64
|
|
60
65
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
61
66
|
s.add_runtime_dependency(%q<require_all>, ["~> 1.3"])
|
62
|
-
s.add_development_dependency(%q<shoulda>, ["~> 3.5"])
|
63
67
|
s.add_development_dependency(%q<rdoc>, ["~> 3.12"])
|
64
68
|
s.add_development_dependency(%q<bundler>, ["~> 1.0"])
|
65
69
|
s.add_development_dependency(%q<jeweler>, ["~> 2.0"])
|
66
70
|
s.add_development_dependency(%q<simplecov>, ["~> 0.11"])
|
71
|
+
s.add_development_dependency(%q<rspec>, ["~> 3.4"])
|
67
72
|
s.add_development_dependency(%q<pry>, ["~> 0.10"])
|
68
73
|
s.add_development_dependency(%q<pry-doc>, ["~> 0.8"])
|
69
74
|
s.add_development_dependency(%q<byebug>, ["~> 8.2"])
|
70
75
|
else
|
71
76
|
s.add_dependency(%q<require_all>, ["~> 1.3"])
|
72
|
-
s.add_dependency(%q<shoulda>, ["~> 3.5"])
|
73
77
|
s.add_dependency(%q<rdoc>, ["~> 3.12"])
|
74
78
|
s.add_dependency(%q<bundler>, ["~> 1.0"])
|
75
79
|
s.add_dependency(%q<jeweler>, ["~> 2.0"])
|
76
80
|
s.add_dependency(%q<simplecov>, ["~> 0.11"])
|
81
|
+
s.add_dependency(%q<rspec>, ["~> 3.4"])
|
77
82
|
s.add_dependency(%q<pry>, ["~> 0.10"])
|
78
83
|
s.add_dependency(%q<pry-doc>, ["~> 0.8"])
|
79
84
|
s.add_dependency(%q<byebug>, ["~> 8.2"])
|
80
85
|
end
|
81
86
|
else
|
82
87
|
s.add_dependency(%q<require_all>, ["~> 1.3"])
|
83
|
-
s.add_dependency(%q<shoulda>, ["~> 3.5"])
|
84
88
|
s.add_dependency(%q<rdoc>, ["~> 3.12"])
|
85
89
|
s.add_dependency(%q<bundler>, ["~> 1.0"])
|
86
90
|
s.add_dependency(%q<jeweler>, ["~> 2.0"])
|
87
91
|
s.add_dependency(%q<simplecov>, ["~> 0.11"])
|
92
|
+
s.add_dependency(%q<rspec>, ["~> 3.4"])
|
88
93
|
s.add_dependency(%q<pry>, ["~> 0.10"])
|
89
94
|
s.add_dependency(%q<pry-doc>, ["~> 0.8"])
|
90
95
|
s.add_dependency(%q<byebug>, ["~> 8.2"])
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'diamond-lang'
|
2
|
+
|
3
|
+
class Conveyor < DiamondLang::OneCommand
|
4
|
+
def setup(c)
|
5
|
+
c.title s(:a), :subtitle, {"\"text\"" => "command by Ben from bensites.com"}
|
6
|
+
c.title s(:a), :title, {"\"text\"" => "Conveyor Belts"}
|
7
|
+
end
|
8
|
+
def tick(c)
|
9
|
+
black_carpet = b 'carpet', colors(:black)
|
10
|
+
pistons = (2..5).map {|d| [d, b('piston', d)]}.each do |d, piston|
|
11
|
+
c.execute s(:e), relative,
|
12
|
+
:detect, relative, black_carpet,
|
13
|
+
:execute, s_self, relative,
|
14
|
+
:detect, coords('~', '~-1', '~'), piston,
|
15
|
+
:tp, s_self, (d == 2 && "~ ~ ~-.2" ) ||
|
16
|
+
(d == 3 && "~ ~ ~.2") ||
|
17
|
+
(d == 4 && "~-.2 ~ ~") ||
|
18
|
+
(d == 5 && "~.2 ~ ~")
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
Conveyor.create
|
@@ -2,9 +2,8 @@ module DiamondLang
|
|
2
2
|
module Helpers
|
3
3
|
class TargetSelector
|
4
4
|
attr_accessor :arguments
|
5
|
-
def initialize(
|
6
|
-
variable, @arguments =
|
7
|
-
@variable = "@#{variable}"
|
5
|
+
def initialize(variable, arguments={})
|
6
|
+
@variable, @arguments = "@#{variable}", arguments
|
8
7
|
end
|
9
8
|
def <<(arguments)
|
10
9
|
@arguments = @arguments.merge arguments
|
@@ -7,7 +7,8 @@ module DiamondLang
|
|
7
7
|
@@instance = self.new(*args)
|
8
8
|
puts @@instance.to_command.to_s.gsub(/\\?"(\w+?)\\?":/, '\1:')
|
9
9
|
end
|
10
|
-
def initialize(height=5, length=6, width=5, offset=coords(2, 2, 0), surrond=Helpers::Block.new('stained_hardened_clay', 13))
|
10
|
+
def initialize(height=5, length=6, width=5, offset=coords(2, 2, 0), surrond=Helpers::Block.new('stained_hardened_clay', 13), output=false)
|
11
|
+
@output = output
|
11
12
|
@height = height # y
|
12
13
|
@width = width # z
|
13
14
|
@length = (length / 2).floor * 2 # x
|
@@ -51,7 +52,7 @@ module DiamondLang
|
|
51
52
|
y.even? ? level : level.reverse
|
52
53
|
end
|
53
54
|
command_levels.first.first.first.type = :repeating
|
54
|
-
raise Errors::TooSmall if command_levels.to_a.length > (@height -
|
55
|
+
raise Errors::TooSmall if command_levels.to_a.length > (@height - 1)
|
55
56
|
command_levels.each_with_index do |level, y|
|
56
57
|
level.each_with_index do |line, z|
|
57
58
|
z += @width - 1 - level.length if y.odd?
|
@@ -97,8 +98,37 @@ module DiamondLang
|
|
97
98
|
def s(*args)
|
98
99
|
Helpers::TargetSelector.new(*args)
|
99
100
|
end
|
101
|
+
def sp
|
102
|
+
s :p
|
103
|
+
end
|
104
|
+
def s_self
|
105
|
+
s :e, {r: 0, c: 1}
|
106
|
+
end
|
100
107
|
def coords(*args)
|
101
108
|
Helpers::Coordinates.new(*args)
|
102
109
|
end
|
110
|
+
def relative
|
111
|
+
coords('~', '~', '~')
|
112
|
+
end
|
113
|
+
def colors(color)
|
114
|
+
{
|
115
|
+
white: 0,
|
116
|
+
orange: 1,
|
117
|
+
magenta: 2,
|
118
|
+
light_blue: 3,
|
119
|
+
yellow: 4,
|
120
|
+
lime: 5,
|
121
|
+
pink: 6,
|
122
|
+
grey: 7,
|
123
|
+
light_grey: 8,
|
124
|
+
cyan: 9,
|
125
|
+
purple: 10,
|
126
|
+
blue: 11,
|
127
|
+
brown: 12,
|
128
|
+
green: 13,
|
129
|
+
red: 14,
|
130
|
+
black: 15
|
131
|
+
}.freeze[color]
|
132
|
+
end
|
103
133
|
end
|
104
134
|
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
require 'helper'
|
2
|
+
include DiamondLang
|
3
|
+
|
4
|
+
describe Errors::InvalidAxis do
|
5
|
+
%w[i w a].each do |axis|
|
6
|
+
context "with the invalid axis being #{axis}" do
|
7
|
+
subject(:message) {Errors::InvalidAxis.new(axis).message}
|
8
|
+
it {is_expected.to eq("A cordinate was created with an axis of #{axis}, which isn't in: [x, y, z]")}
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
require 'helper'
|
2
|
+
include DiamondLang
|
3
|
+
|
4
|
+
describe Errors::InvalidCoordinateValue do
|
5
|
+
%w[5f ~!2!].each do |value|
|
6
|
+
context "with the invalid value being #{value}" do
|
7
|
+
subject(:message) {Errors::InvalidCoordinateValue.new(value).message}
|
8
|
+
it {is_expected.to eq("#{value} isn't a valid coordinate.")}
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
require 'helper'
|
2
|
+
include DiamondLang
|
3
|
+
|
4
|
+
describe Errors::RelativeCordinateConvertedToArgument do
|
5
|
+
subject(:error) {Errors::RelativeCordinateConvertedToArgument.new}
|
6
|
+
context "with the default message" do
|
7
|
+
subject(:message) {error.message}
|
8
|
+
it {is_expected.to eq("A relative cordinate was converted to an argument.")}
|
9
|
+
end
|
10
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
require 'helper'
|
2
|
+
include DiamondLang
|
3
|
+
|
4
|
+
describe Errors::TooSmall do
|
5
|
+
subject(:error) {Errors::TooSmall.new}
|
6
|
+
context "with the default message" do
|
7
|
+
subject(:message) {error.message}
|
8
|
+
it {is_expected.to eq("Could not fit all commands in the area you selected.")}
|
9
|
+
end
|
10
|
+
end
|
data/{test → spec}/helper.rb
RENAMED
@@ -8,13 +8,14 @@ end
|
|
8
8
|
|
9
9
|
SimpleCov.configure do
|
10
10
|
clean_filters
|
11
|
-
|
11
|
+
load_profile 'test_frameworks'
|
12
12
|
end
|
13
13
|
|
14
14
|
ENV["COVERAGE"] && SimpleCov.start do
|
15
|
+
formatter SimpleCov::Formatter::HTMLFormatter
|
15
16
|
add_filter "/.rvm/"
|
16
17
|
end
|
17
|
-
|
18
|
+
|
18
19
|
require 'bundler'
|
19
20
|
begin
|
20
21
|
Bundler.setup(:default, :development)
|
@@ -23,12 +24,14 @@ rescue Bundler::BundlerError => e
|
|
23
24
|
$stderr.puts "Run `bundle install` to install missing gems"
|
24
25
|
exit e.status_code
|
25
26
|
end
|
26
|
-
require 'test/unit'
|
27
|
-
require 'shoulda'
|
28
27
|
|
29
28
|
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
30
29
|
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
30
|
+
require 'rspec'
|
31
31
|
require 'diamond-lang'
|
32
32
|
|
33
|
-
|
33
|
+
# Requires supporting files with custom matchers and macros, etc,
|
34
|
+
# in ./support/ and its subdirectories.
|
35
|
+
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
|
36
|
+
RSpec.configure do |config|
|
34
37
|
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
require 'helper'
|
2
|
+
include DiamondLang
|
3
|
+
|
4
|
+
describe Helpers::Block do
|
5
|
+
context "with no nbt data" do
|
6
|
+
(0..2).each do |data_value|
|
7
|
+
context "with a data value of #{data_value}" do
|
8
|
+
%w[stone sand wood].each do |id|
|
9
|
+
context "with an id of #{id}" do
|
10
|
+
subject(:block) {Helpers::Block.new id, data_value}
|
11
|
+
it "is #{id}" do
|
12
|
+
expect(block.id).to eq(id)
|
13
|
+
end
|
14
|
+
it "has a data value of #{data_value}" do
|
15
|
+
expect(block.data_value).to eq(data_value)
|
16
|
+
end
|
17
|
+
it "converts to a string" do
|
18
|
+
expect(block.to_s).to eq("#{id} #{data_value}")
|
19
|
+
end
|
20
|
+
it "converts to a string with a replace method" do
|
21
|
+
expect(block.to_s(:replace)).to eq("#{id} #{data_value} replace")
|
22
|
+
end
|
23
|
+
context "when converted to falling sand" do
|
24
|
+
subject(:falling_sand) {block.to_falling_sand}
|
25
|
+
|
26
|
+
it {is_expected.to be_a(Helpers::FallingSand)}
|
27
|
+
|
28
|
+
it "is a FallingSand entity" do
|
29
|
+
expect(falling_sand.id).to eq("FallingSand")
|
30
|
+
end
|
31
|
+
it "has a block id of stone" do
|
32
|
+
expect(falling_sand.data[:Block]).to eq(id)
|
33
|
+
end
|
34
|
+
it "has a time of 1" do
|
35
|
+
expect(falling_sand.data[:Time]).to eq(1)
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
data/spec/index.html
ADDED
@@ -0,0 +1,615 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html lang='en'>
|
3
|
+
<head>
|
4
|
+
<title>RSpec results</title>
|
5
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
6
|
+
<meta http-equiv="Expires" content="-1" />
|
7
|
+
<meta http-equiv="Pragma" content="no-cache" />
|
8
|
+
<style type="text/css">
|
9
|
+
body {
|
10
|
+
margin: 0;
|
11
|
+
padding: 0;
|
12
|
+
background: #fff;
|
13
|
+
font-size: 80%;
|
14
|
+
}
|
15
|
+
</style>
|
16
|
+
<script type="text/javascript">
|
17
|
+
// <![CDATA[
|
18
|
+
|
19
|
+
function addClass(element_id, classname) {
|
20
|
+
document.getElementById(element_id).className += (" " + classname);
|
21
|
+
}
|
22
|
+
|
23
|
+
function removeClass(element_id, classname) {
|
24
|
+
var elem = document.getElementById(element_id);
|
25
|
+
var classlist = elem.className.replace(classname,'');
|
26
|
+
elem.className = classlist;
|
27
|
+
}
|
28
|
+
|
29
|
+
function moveProgressBar(percentDone) {
|
30
|
+
document.getElementById("rspec-header").style.width = percentDone +"%";
|
31
|
+
}
|
32
|
+
|
33
|
+
function makeRed(element_id) {
|
34
|
+
removeClass(element_id, 'passed');
|
35
|
+
removeClass(element_id, 'not_implemented');
|
36
|
+
addClass(element_id,'failed');
|
37
|
+
}
|
38
|
+
|
39
|
+
function makeYellow(element_id) {
|
40
|
+
var elem = document.getElementById(element_id);
|
41
|
+
if (elem.className.indexOf("failed") == -1) { // class doesn't includes failed
|
42
|
+
if (elem.className.indexOf("not_implemented") == -1) { // class doesn't include not_implemented
|
43
|
+
removeClass(element_id, 'passed');
|
44
|
+
addClass(element_id,'not_implemented');
|
45
|
+
}
|
46
|
+
}
|
47
|
+
}
|
48
|
+
|
49
|
+
function apply_filters() {
|
50
|
+
var passed_filter = document.getElementById('passed_checkbox').checked;
|
51
|
+
var failed_filter = document.getElementById('failed_checkbox').checked;
|
52
|
+
var pending_filter = document.getElementById('pending_checkbox').checked;
|
53
|
+
|
54
|
+
assign_display_style("example passed", passed_filter);
|
55
|
+
assign_display_style("example failed", failed_filter);
|
56
|
+
assign_display_style("example not_implemented", pending_filter);
|
57
|
+
|
58
|
+
assign_display_style_for_group("example_group passed", passed_filter);
|
59
|
+
assign_display_style_for_group("example_group not_implemented", pending_filter, pending_filter || passed_filter);
|
60
|
+
assign_display_style_for_group("example_group failed", failed_filter, failed_filter || pending_filter || passed_filter);
|
61
|
+
}
|
62
|
+
|
63
|
+
function get_display_style(display_flag) {
|
64
|
+
var style_mode = 'none';
|
65
|
+
if (display_flag == true) {
|
66
|
+
style_mode = 'block';
|
67
|
+
}
|
68
|
+
return style_mode;
|
69
|
+
}
|
70
|
+
|
71
|
+
function assign_display_style(classname, display_flag) {
|
72
|
+
var style_mode = get_display_style(display_flag);
|
73
|
+
var elems = document.getElementsByClassName(classname)
|
74
|
+
for (var i=0; i<elems.length;i++) {
|
75
|
+
elems[i].style.display = style_mode;
|
76
|
+
}
|
77
|
+
}
|
78
|
+
|
79
|
+
function assign_display_style_for_group(classname, display_flag, subgroup_flag) {
|
80
|
+
var display_style_mode = get_display_style(display_flag);
|
81
|
+
var subgroup_style_mode = get_display_style(subgroup_flag);
|
82
|
+
var elems = document.getElementsByClassName(classname)
|
83
|
+
for (var i=0; i<elems.length;i++) {
|
84
|
+
var style_mode = display_style_mode;
|
85
|
+
if ((display_flag != subgroup_flag) && (elems[i].getElementsByTagName('dt')[0].innerHTML.indexOf(", ") != -1)) {
|
86
|
+
elems[i].style.display = subgroup_style_mode;
|
87
|
+
} else {
|
88
|
+
elems[i].style.display = display_style_mode;
|
89
|
+
}
|
90
|
+
}
|
91
|
+
}
|
92
|
+
|
93
|
+
// ]]>
|
94
|
+
</script>
|
95
|
+
<style type="text/css">
|
96
|
+
#rspec-header {
|
97
|
+
background: #65C400; color: #fff; height: 4em;
|
98
|
+
}
|
99
|
+
|
100
|
+
.rspec-report h1 {
|
101
|
+
margin: 0px 10px 0px 10px;
|
102
|
+
padding: 10px;
|
103
|
+
font-family: "Lucida Grande", Helvetica, sans-serif;
|
104
|
+
font-size: 1.8em;
|
105
|
+
position: absolute;
|
106
|
+
}
|
107
|
+
|
108
|
+
#label {
|
109
|
+
float:left;
|
110
|
+
}
|
111
|
+
|
112
|
+
#display-filters {
|
113
|
+
float:left;
|
114
|
+
padding: 28px 0 0 40%;
|
115
|
+
font-family: "Lucida Grande", Helvetica, sans-serif;
|
116
|
+
}
|
117
|
+
|
118
|
+
#summary {
|
119
|
+
float:right;
|
120
|
+
padding: 5px 10px;
|
121
|
+
font-family: "Lucida Grande", Helvetica, sans-serif;
|
122
|
+
text-align: right;
|
123
|
+
}
|
124
|
+
|
125
|
+
#summary p {
|
126
|
+
margin: 0 0 0 2px;
|
127
|
+
}
|
128
|
+
|
129
|
+
#summary #totals {
|
130
|
+
font-size: 1.2em;
|
131
|
+
}
|
132
|
+
|
133
|
+
.example_group {
|
134
|
+
margin: 0 10px 5px;
|
135
|
+
background: #fff;
|
136
|
+
}
|
137
|
+
|
138
|
+
dl {
|
139
|
+
margin: 0; padding: 0 0 5px;
|
140
|
+
font: normal 11px "Lucida Grande", Helvetica, sans-serif;
|
141
|
+
}
|
142
|
+
|
143
|
+
dt {
|
144
|
+
padding: 3px;
|
145
|
+
background: #65C400;
|
146
|
+
color: #fff;
|
147
|
+
font-weight: bold;
|
148
|
+
}
|
149
|
+
|
150
|
+
dd {
|
151
|
+
margin: 5px 0 5px 5px;
|
152
|
+
padding: 3px 3px 3px 18px;
|
153
|
+
}
|
154
|
+
|
155
|
+
dd .duration {
|
156
|
+
padding-left: 5px;
|
157
|
+
text-align: right;
|
158
|
+
right: 0px;
|
159
|
+
float:right;
|
160
|
+
}
|
161
|
+
|
162
|
+
dd.example.passed {
|
163
|
+
border-left: 5px solid #65C400;
|
164
|
+
border-bottom: 1px solid #65C400;
|
165
|
+
background: #DBFFB4; color: #3D7700;
|
166
|
+
}
|
167
|
+
|
168
|
+
dd.example.not_implemented {
|
169
|
+
border-left: 5px solid #FAF834;
|
170
|
+
border-bottom: 1px solid #FAF834;
|
171
|
+
background: #FCFB98; color: #131313;
|
172
|
+
}
|
173
|
+
|
174
|
+
dd.example.pending_fixed {
|
175
|
+
border-left: 5px solid #0000C2;
|
176
|
+
border-bottom: 1px solid #0000C2;
|
177
|
+
color: #0000C2; background: #D3FBFF;
|
178
|
+
}
|
179
|
+
|
180
|
+
dd.example.failed {
|
181
|
+
border-left: 5px solid #C20000;
|
182
|
+
border-bottom: 1px solid #C20000;
|
183
|
+
color: #C20000; background: #FFFBD3;
|
184
|
+
}
|
185
|
+
|
186
|
+
|
187
|
+
dt.not_implemented {
|
188
|
+
color: #000000; background: #FAF834;
|
189
|
+
}
|
190
|
+
|
191
|
+
dt.pending_fixed {
|
192
|
+
color: #FFFFFF; background: #C40D0D;
|
193
|
+
}
|
194
|
+
|
195
|
+
dt.failed {
|
196
|
+
color: #FFFFFF; background: #C40D0D;
|
197
|
+
}
|
198
|
+
|
199
|
+
|
200
|
+
#rspec-header.not_implemented {
|
201
|
+
color: #000000; background: #FAF834;
|
202
|
+
}
|
203
|
+
|
204
|
+
#rspec-header.pending_fixed {
|
205
|
+
color: #FFFFFF; background: #C40D0D;
|
206
|
+
}
|
207
|
+
|
208
|
+
#rspec-header.failed {
|
209
|
+
color: #FFFFFF; background: #C40D0D;
|
210
|
+
}
|
211
|
+
|
212
|
+
|
213
|
+
.backtrace {
|
214
|
+
color: #000;
|
215
|
+
font-size: 12px;
|
216
|
+
}
|
217
|
+
|
218
|
+
a {
|
219
|
+
color: #BE5C00;
|
220
|
+
}
|
221
|
+
|
222
|
+
/* Ruby code, style similar to vibrant ink */
|
223
|
+
.ruby {
|
224
|
+
font-size: 12px;
|
225
|
+
font-family: monospace;
|
226
|
+
color: white;
|
227
|
+
background-color: black;
|
228
|
+
padding: 0.1em 0 0.2em 0;
|
229
|
+
}
|
230
|
+
|
231
|
+
.ruby .keyword { color: #FF6600; }
|
232
|
+
.ruby .constant { color: #339999; }
|
233
|
+
.ruby .attribute { color: white; }
|
234
|
+
.ruby .global { color: white; }
|
235
|
+
.ruby .module { color: white; }
|
236
|
+
.ruby .class { color: white; }
|
237
|
+
.ruby .string { color: #66FF00; }
|
238
|
+
.ruby .ident { color: white; }
|
239
|
+
.ruby .method { color: #FFCC00; }
|
240
|
+
.ruby .number { color: white; }
|
241
|
+
.ruby .char { color: white; }
|
242
|
+
.ruby .comment { color: #9933CC; }
|
243
|
+
.ruby .symbol { color: white; }
|
244
|
+
.ruby .regex { color: #44B4CC; }
|
245
|
+
.ruby .punct { color: white; }
|
246
|
+
.ruby .escape { color: white; }
|
247
|
+
.ruby .interp { color: white; }
|
248
|
+
.ruby .expr { color: white; }
|
249
|
+
|
250
|
+
.ruby .offending { background-color: gray; }
|
251
|
+
.ruby .linenum {
|
252
|
+
width: 75px;
|
253
|
+
padding: 0.1em 1em 0.2em 0;
|
254
|
+
color: #000000;
|
255
|
+
background-color: #FFFBD3;
|
256
|
+
}
|
257
|
+
|
258
|
+
</style>
|
259
|
+
</head>
|
260
|
+
<body>
|
261
|
+
<div class="rspec-report">
|
262
|
+
|
263
|
+
<div id="rspec-header">
|
264
|
+
<div id="label">
|
265
|
+
<h1>RSpec Code Examples</h1>
|
266
|
+
</div>
|
267
|
+
|
268
|
+
<div id="display-filters">
|
269
|
+
<input id="passed_checkbox" name="passed_checkbox" type="checkbox" checked="checked" onchange="apply_filters()" value="1" /> <label for="passed_checkbox">Passed</label>
|
270
|
+
<input id="failed_checkbox" name="failed_checkbox" type="checkbox" checked="checked" onchange="apply_filters()" value="2" /> <label for="failed_checkbox">Failed</label>
|
271
|
+
<input id="pending_checkbox" name="pending_checkbox" type="checkbox" checked="checked" onchange="apply_filters()" value="3" /> <label for="pending_checkbox">Pending</label>
|
272
|
+
</div>
|
273
|
+
|
274
|
+
<div id="summary">
|
275
|
+
<p id="totals"> </p>
|
276
|
+
<p id="duration"> </p>
|
277
|
+
</div>
|
278
|
+
</div>
|
279
|
+
|
280
|
+
|
281
|
+
<div class="results">
|
282
|
+
<div id="div_group_1" class="example_group passed">
|
283
|
+
<dl style="margin-left: 0px;">
|
284
|
+
<dt id="example_group_1" class="passed">DiamondLang::Errors::InvalidAxis</dt>
|
285
|
+
</dl>
|
286
|
+
</div>
|
287
|
+
<div id="div_group_2" class="example_group passed">
|
288
|
+
<dl style="margin-left: 15px;">
|
289
|
+
<dt id="example_group_2" class="passed">with the invalid axis being i</dt>
|
290
|
+
<script type="text/javascript">moveProgressBar('1.2');</script>
|
291
|
+
<dd class="example passed"><span class="passed_spec_name">should eq "A cordinate was created with an axis of i, which isn't in: [x, y, z]"</span><span class='duration'>0.00243s</span></dd>
|
292
|
+
</dl>
|
293
|
+
</div>
|
294
|
+
<div id="div_group_3" class="example_group passed">
|
295
|
+
<dl style="margin-left: 15px;">
|
296
|
+
<dt id="example_group_3" class="passed">with the invalid axis being w</dt>
|
297
|
+
<script type="text/javascript">moveProgressBar('2.5');</script>
|
298
|
+
<dd class="example passed"><span class="passed_spec_name">should eq "A cordinate was created with an axis of w, which isn't in: [x, y, z]"</span><span class='duration'>0.00020s</span></dd>
|
299
|
+
</dl>
|
300
|
+
</div>
|
301
|
+
<div id="div_group_4" class="example_group passed">
|
302
|
+
<dl style="margin-left: 15px;">
|
303
|
+
<dt id="example_group_4" class="passed">with the invalid axis being a</dt>
|
304
|
+
<script type="text/javascript">moveProgressBar('3.7');</script>
|
305
|
+
<dd class="example passed"><span class="passed_spec_name">should eq "A cordinate was created with an axis of a, which isn't in: [x, y, z]"</span><span class='duration'>0.00013s</span></dd>
|
306
|
+
</dl>
|
307
|
+
</div>
|
308
|
+
<div id="div_group_5" class="example_group passed">
|
309
|
+
<dl style="margin-left: 0px;">
|
310
|
+
<dt id="example_group_5" class="passed">DiamondLang::Errors::InvalidCoordinateValue</dt>
|
311
|
+
</dl>
|
312
|
+
</div>
|
313
|
+
<div id="div_group_6" class="example_group passed">
|
314
|
+
<dl style="margin-left: 15px;">
|
315
|
+
<dt id="example_group_6" class="passed">with the invalid value being 5f</dt>
|
316
|
+
<script type="text/javascript">moveProgressBar('5.0');</script>
|
317
|
+
<dd class="example passed"><span class="passed_spec_name">should eq "5f isn't a valid coordinate."</span><span class='duration'>0.00015s</span></dd>
|
318
|
+
</dl>
|
319
|
+
</div>
|
320
|
+
<div id="div_group_7" class="example_group passed">
|
321
|
+
<dl style="margin-left: 15px;">
|
322
|
+
<dt id="example_group_7" class="passed">with the invalid value being ~!2!</dt>
|
323
|
+
<script type="text/javascript">moveProgressBar('6.3');</script>
|
324
|
+
<dd class="example passed"><span class="passed_spec_name">should eq "~!2! isn't a valid coordinate."</span><span class='duration'>0.00012s</span></dd>
|
325
|
+
</dl>
|
326
|
+
</div>
|
327
|
+
<div id="div_group_8" class="example_group passed">
|
328
|
+
<dl style="margin-left: 0px;">
|
329
|
+
<dt id="example_group_8" class="passed">DiamondLang::Errors::RelativeCordinateConvertedToArgument</dt>
|
330
|
+
</dl>
|
331
|
+
</div>
|
332
|
+
<div id="div_group_9" class="example_group passed">
|
333
|
+
<dl style="margin-left: 15px;">
|
334
|
+
<dt id="example_group_9" class="passed">with the default message</dt>
|
335
|
+
<script type="text/javascript">moveProgressBar('7.5');</script>
|
336
|
+
<dd class="example passed"><span class="passed_spec_name">should eq "A relative cordinate was converted to an argument."</span><span class='duration'>0.00016s</span></dd>
|
337
|
+
</dl>
|
338
|
+
</div>
|
339
|
+
<div id="div_group_10" class="example_group passed">
|
340
|
+
<dl style="margin-left: 0px;">
|
341
|
+
<dt id="example_group_10" class="passed">DiamondLang::Errors::TooSmall</dt>
|
342
|
+
</dl>
|
343
|
+
</div>
|
344
|
+
<div id="div_group_11" class="example_group passed">
|
345
|
+
<dl style="margin-left: 15px;">
|
346
|
+
<dt id="example_group_11" class="passed">with the default message</dt>
|
347
|
+
<script type="text/javascript">moveProgressBar('8.8');</script>
|
348
|
+
<dd class="example passed"><span class="passed_spec_name">should eq "Could not fit all commands in the area you selected."</span><span class='duration'>0.00014s</span></dd>
|
349
|
+
</dl>
|
350
|
+
</div>
|
351
|
+
<div id="div_group_12" class="example_group passed">
|
352
|
+
<dl style="margin-left: 0px;">
|
353
|
+
<dt id="example_group_12" class="passed">DiamondLang::Helpers::Block</dt>
|
354
|
+
</dl>
|
355
|
+
</div>
|
356
|
+
<div id="div_group_13" class="example_group passed">
|
357
|
+
<dl style="margin-left: 15px;">
|
358
|
+
<dt id="example_group_13" class="passed">with no nbt data</dt>
|
359
|
+
</dl>
|
360
|
+
</div>
|
361
|
+
<div id="div_group_14" class="example_group passed">
|
362
|
+
<dl style="margin-left: 30px;">
|
363
|
+
<dt id="example_group_14" class="passed">with a data value of 0</dt>
|
364
|
+
</dl>
|
365
|
+
</div>
|
366
|
+
<div id="div_group_15" class="example_group passed">
|
367
|
+
<dl style="margin-left: 45px;">
|
368
|
+
<dt id="example_group_15" class="passed">with an id of stone</dt>
|
369
|
+
<script type="text/javascript">moveProgressBar('10.1');</script>
|
370
|
+
<dd class="example passed"><span class="passed_spec_name">is stone</span><span class='duration'>0.00010s</span></dd>
|
371
|
+
<script type="text/javascript">moveProgressBar('11.3');</script>
|
372
|
+
<dd class="example passed"><span class="passed_spec_name">has a data value of 0</span><span class='duration'>0.00009s</span></dd>
|
373
|
+
<script type="text/javascript">moveProgressBar('12.6');</script>
|
374
|
+
<dd class="example passed"><span class="passed_spec_name">converts to a string</span><span class='duration'>0.00012s</span></dd>
|
375
|
+
<script type="text/javascript">moveProgressBar('13.9');</script>
|
376
|
+
<dd class="example passed"><span class="passed_spec_name">converts to a string with a replace method</span><span class='duration'>0.00010s</span></dd>
|
377
|
+
</dl>
|
378
|
+
</div>
|
379
|
+
<div id="div_group_16" class="example_group passed">
|
380
|
+
<dl style="margin-left: 60px;">
|
381
|
+
<dt id="example_group_16" class="passed">when converted to falling sand</dt>
|
382
|
+
<script type="text/javascript">moveProgressBar('15.1');</script>
|
383
|
+
<dd class="example passed"><span class="passed_spec_name">should be a kind of DiamondLang::Helpers::FallingSand</span><span class='duration'>0.00158s</span></dd>
|
384
|
+
<script type="text/javascript">moveProgressBar('16.4');</script>
|
385
|
+
<dd class="example passed"><span class="passed_spec_name">is a FallingSand entity</span><span class='duration'>0.00016s</span></dd>
|
386
|
+
<script type="text/javascript">moveProgressBar('17.7');</script>
|
387
|
+
<dd class="example passed"><span class="passed_spec_name">has a block id of stone</span><span class='duration'>0.00010s</span></dd>
|
388
|
+
<script type="text/javascript">moveProgressBar('18.9');</script>
|
389
|
+
<dd class="example passed"><span class="passed_spec_name">has a time of 1</span><span class='duration'>0.00013s</span></dd>
|
390
|
+
</dl>
|
391
|
+
</div>
|
392
|
+
<div id="div_group_17" class="example_group passed">
|
393
|
+
<dl style="margin-left: 45px;">
|
394
|
+
<dt id="example_group_17" class="passed">with an id of sand</dt>
|
395
|
+
<script type="text/javascript">moveProgressBar('20.2');</script>
|
396
|
+
<dd class="example passed"><span class="passed_spec_name">is sand</span><span class='duration'>0.00010s</span></dd>
|
397
|
+
<script type="text/javascript">moveProgressBar('21.5');</script>
|
398
|
+
<dd class="example passed"><span class="passed_spec_name">has a data value of 0</span><span class='duration'>0.00009s</span></dd>
|
399
|
+
<script type="text/javascript">moveProgressBar('22.7');</script>
|
400
|
+
<dd class="example passed"><span class="passed_spec_name">converts to a string</span><span class='duration'>0.00011s</span></dd>
|
401
|
+
<script type="text/javascript">moveProgressBar('24.0');</script>
|
402
|
+
<dd class="example passed"><span class="passed_spec_name">converts to a string with a replace method</span><span class='duration'>0.00010s</span></dd>
|
403
|
+
</dl>
|
404
|
+
</div>
|
405
|
+
<div id="div_group_18" class="example_group passed">
|
406
|
+
<dl style="margin-left: 60px;">
|
407
|
+
<dt id="example_group_18" class="passed">when converted to falling sand</dt>
|
408
|
+
<script type="text/javascript">moveProgressBar('25.3');</script>
|
409
|
+
<dd class="example passed"><span class="passed_spec_name">should be a kind of DiamondLang::Helpers::FallingSand</span><span class='duration'>0.00017s</span></dd>
|
410
|
+
<script type="text/javascript">moveProgressBar('26.5');</script>
|
411
|
+
<dd class="example passed"><span class="passed_spec_name">is a FallingSand entity</span><span class='duration'>0.00009s</span></dd>
|
412
|
+
<script type="text/javascript">moveProgressBar('27.8');</script>
|
413
|
+
<dd class="example passed"><span class="passed_spec_name">has a block id of stone</span><span class='duration'>0.00012s</span></dd>
|
414
|
+
<script type="text/javascript">moveProgressBar('29.1');</script>
|
415
|
+
<dd class="example passed"><span class="passed_spec_name">has a time of 1</span><span class='duration'>0.00009s</span></dd>
|
416
|
+
</dl>
|
417
|
+
</div>
|
418
|
+
<div id="div_group_19" class="example_group passed">
|
419
|
+
<dl style="margin-left: 45px;">
|
420
|
+
<dt id="example_group_19" class="passed">with an id of wood</dt>
|
421
|
+
<script type="text/javascript">moveProgressBar('30.3');</script>
|
422
|
+
<dd class="example passed"><span class="passed_spec_name">is wood</span><span class='duration'>0.00011s</span></dd>
|
423
|
+
<script type="text/javascript">moveProgressBar('31.6');</script>
|
424
|
+
<dd class="example passed"><span class="passed_spec_name">has a data value of 0</span><span class='duration'>0.00009s</span></dd>
|
425
|
+
<script type="text/javascript">moveProgressBar('32.9');</script>
|
426
|
+
<dd class="example passed"><span class="passed_spec_name">converts to a string</span><span class='duration'>0.00010s</span></dd>
|
427
|
+
<script type="text/javascript">moveProgressBar('34.1');</script>
|
428
|
+
<dd class="example passed"><span class="passed_spec_name">converts to a string with a replace method</span><span class='duration'>0.00018s</span></dd>
|
429
|
+
</dl>
|
430
|
+
</div>
|
431
|
+
<div id="div_group_20" class="example_group passed">
|
432
|
+
<dl style="margin-left: 60px;">
|
433
|
+
<dt id="example_group_20" class="passed">when converted to falling sand</dt>
|
434
|
+
<script type="text/javascript">moveProgressBar('35.4');</script>
|
435
|
+
<dd class="example passed"><span class="passed_spec_name">should be a kind of DiamondLang::Helpers::FallingSand</span><span class='duration'>0.00016s</span></dd>
|
436
|
+
<script type="text/javascript">moveProgressBar('36.7');</script>
|
437
|
+
<dd class="example passed"><span class="passed_spec_name">is a FallingSand entity</span><span class='duration'>0.00015s</span></dd>
|
438
|
+
<script type="text/javascript">moveProgressBar('37.9');</script>
|
439
|
+
<dd class="example passed"><span class="passed_spec_name">has a block id of stone</span><span class='duration'>0.00009s</span></dd>
|
440
|
+
<script type="text/javascript">moveProgressBar('39.2');</script>
|
441
|
+
<dd class="example passed"><span class="passed_spec_name">has a time of 1</span><span class='duration'>0.00009s</span></dd>
|
442
|
+
</dl>
|
443
|
+
</div>
|
444
|
+
<div id="div_group_21" class="example_group passed">
|
445
|
+
<dl style="margin-left: 30px;">
|
446
|
+
<dt id="example_group_21" class="passed">with a data value of 1</dt>
|
447
|
+
</dl>
|
448
|
+
</div>
|
449
|
+
<div id="div_group_22" class="example_group passed">
|
450
|
+
<dl style="margin-left: 45px;">
|
451
|
+
<dt id="example_group_22" class="passed">with an id of stone</dt>
|
452
|
+
<script type="text/javascript">moveProgressBar('40.5');</script>
|
453
|
+
<dd class="example passed"><span class="passed_spec_name">is stone</span><span class='duration'>0.00009s</span></dd>
|
454
|
+
<script type="text/javascript">moveProgressBar('41.7');</script>
|
455
|
+
<dd class="example passed"><span class="passed_spec_name">has a data value of 1</span><span class='duration'>0.00011s</span></dd>
|
456
|
+
<script type="text/javascript">moveProgressBar('43.0');</script>
|
457
|
+
<dd class="example passed"><span class="passed_spec_name">converts to a string</span><span class='duration'>0.00010s</span></dd>
|
458
|
+
<script type="text/javascript">moveProgressBar('44.3');</script>
|
459
|
+
<dd class="example passed"><span class="passed_spec_name">converts to a string with a replace method</span><span class='duration'>0.00010s</span></dd>
|
460
|
+
</dl>
|
461
|
+
</div>
|
462
|
+
<div id="div_group_23" class="example_group passed">
|
463
|
+
<dl style="margin-left: 60px;">
|
464
|
+
<dt id="example_group_23" class="passed">when converted to falling sand</dt>
|
465
|
+
<script type="text/javascript">moveProgressBar('45.5');</script>
|
466
|
+
<dd class="example passed"><span class="passed_spec_name">should be a kind of DiamondLang::Helpers::FallingSand</span><span class='duration'>0.00013s</span></dd>
|
467
|
+
<script type="text/javascript">moveProgressBar('46.8');</script>
|
468
|
+
<dd class="example passed"><span class="passed_spec_name">is a FallingSand entity</span><span class='duration'>0.00012s</span></dd>
|
469
|
+
<script type="text/javascript">moveProgressBar('48.1');</script>
|
470
|
+
<dd class="example passed"><span class="passed_spec_name">has a block id of stone</span><span class='duration'>0.00009s</span></dd>
|
471
|
+
<script type="text/javascript">moveProgressBar('49.3');</script>
|
472
|
+
<dd class="example passed"><span class="passed_spec_name">has a time of 1</span><span class='duration'>0.00013s</span></dd>
|
473
|
+
</dl>
|
474
|
+
</div>
|
475
|
+
<div id="div_group_24" class="example_group passed">
|
476
|
+
<dl style="margin-left: 45px;">
|
477
|
+
<dt id="example_group_24" class="passed">with an id of sand</dt>
|
478
|
+
<script type="text/javascript">moveProgressBar('50.6');</script>
|
479
|
+
<dd class="example passed"><span class="passed_spec_name">is sand</span><span class='duration'>0.00009s</span></dd>
|
480
|
+
<script type="text/javascript">moveProgressBar('51.8');</script>
|
481
|
+
<dd class="example passed"><span class="passed_spec_name">has a data value of 1</span><span class='duration'>0.00011s</span></dd>
|
482
|
+
<script type="text/javascript">moveProgressBar('53.1');</script>
|
483
|
+
<dd class="example passed"><span class="passed_spec_name">converts to a string</span><span class='duration'>0.00009s</span></dd>
|
484
|
+
<script type="text/javascript">moveProgressBar('54.4');</script>
|
485
|
+
<dd class="example passed"><span class="passed_spec_name">converts to a string with a replace method</span><span class='duration'>0.00009s</span></dd>
|
486
|
+
</dl>
|
487
|
+
</div>
|
488
|
+
<div id="div_group_25" class="example_group passed">
|
489
|
+
<dl style="margin-left: 60px;">
|
490
|
+
<dt id="example_group_25" class="passed">when converted to falling sand</dt>
|
491
|
+
<script type="text/javascript">moveProgressBar('55.6');</script>
|
492
|
+
<dd class="example passed"><span class="passed_spec_name">should be a kind of DiamondLang::Helpers::FallingSand</span><span class='duration'>0.00013s</span></dd>
|
493
|
+
<script type="text/javascript">moveProgressBar('56.9');</script>
|
494
|
+
<dd class="example passed"><span class="passed_spec_name">is a FallingSand entity</span><span class='duration'>0.00009s</span></dd>
|
495
|
+
<script type="text/javascript">moveProgressBar('58.2');</script>
|
496
|
+
<dd class="example passed"><span class="passed_spec_name">has a block id of stone</span><span class='duration'>0.00013s</span></dd>
|
497
|
+
<script type="text/javascript">moveProgressBar('59.4');</script>
|
498
|
+
<dd class="example passed"><span class="passed_spec_name">has a time of 1</span><span class='duration'>0.00009s</span></dd>
|
499
|
+
</dl>
|
500
|
+
</div>
|
501
|
+
<div id="div_group_26" class="example_group passed">
|
502
|
+
<dl style="margin-left: 45px;">
|
503
|
+
<dt id="example_group_26" class="passed">with an id of wood</dt>
|
504
|
+
<script type="text/javascript">moveProgressBar('60.7');</script>
|
505
|
+
<dd class="example passed"><span class="passed_spec_name">is wood</span><span class='duration'>0.00011s</span></dd>
|
506
|
+
<script type="text/javascript">moveProgressBar('62.0');</script>
|
507
|
+
<dd class="example passed"><span class="passed_spec_name">has a data value of 1</span><span class='duration'>0.00008s</span></dd>
|
508
|
+
<script type="text/javascript">moveProgressBar('63.2');</script>
|
509
|
+
<dd class="example passed"><span class="passed_spec_name">converts to a string</span><span class='duration'>0.00010s</span></dd>
|
510
|
+
<script type="text/javascript">moveProgressBar('64.5');</script>
|
511
|
+
<dd class="example passed"><span class="passed_spec_name">converts to a string with a replace method</span><span class='duration'>0.00009s</span></dd>
|
512
|
+
</dl>
|
513
|
+
</div>
|
514
|
+
<div id="div_group_27" class="example_group passed">
|
515
|
+
<dl style="margin-left: 60px;">
|
516
|
+
<dt id="example_group_27" class="passed">when converted to falling sand</dt>
|
517
|
+
<script type="text/javascript">moveProgressBar('65.8');</script>
|
518
|
+
<dd class="example passed"><span class="passed_spec_name">should be a kind of DiamondLang::Helpers::FallingSand</span><span class='duration'>0.00012s</span></dd>
|
519
|
+
<script type="text/javascript">moveProgressBar('67.0');</script>
|
520
|
+
<dd class="example passed"><span class="passed_spec_name">is a FallingSand entity</span><span class='duration'>0.00011s</span></dd>
|
521
|
+
<script type="text/javascript">moveProgressBar('68.3');</script>
|
522
|
+
<dd class="example passed"><span class="passed_spec_name">has a block id of stone</span><span class='duration'>0.00009s</span></dd>
|
523
|
+
<script type="text/javascript">moveProgressBar('69.6');</script>
|
524
|
+
<dd class="example passed"><span class="passed_spec_name">has a time of 1</span><span class='duration'>0.00010s</span></dd>
|
525
|
+
</dl>
|
526
|
+
</div>
|
527
|
+
<div id="div_group_28" class="example_group passed">
|
528
|
+
<dl style="margin-left: 30px;">
|
529
|
+
<dt id="example_group_28" class="passed">with a data value of 2</dt>
|
530
|
+
</dl>
|
531
|
+
</div>
|
532
|
+
<div id="div_group_29" class="example_group passed">
|
533
|
+
<dl style="margin-left: 45px;">
|
534
|
+
<dt id="example_group_29" class="passed">with an id of stone</dt>
|
535
|
+
<script type="text/javascript">moveProgressBar('70.8');</script>
|
536
|
+
<dd class="example passed"><span class="passed_spec_name">is stone</span><span class='duration'>0.00008s</span></dd>
|
537
|
+
<script type="text/javascript">moveProgressBar('72.1');</script>
|
538
|
+
<dd class="example passed"><span class="passed_spec_name">has a data value of 2</span><span class='duration'>0.00011s</span></dd>
|
539
|
+
<script type="text/javascript">moveProgressBar('73.4');</script>
|
540
|
+
<dd class="example passed"><span class="passed_spec_name">converts to a string</span><span class='duration'>0.00010s</span></dd>
|
541
|
+
<script type="text/javascript">moveProgressBar('74.6');</script>
|
542
|
+
<dd class="example passed"><span class="passed_spec_name">converts to a string with a replace method</span><span class='duration'>0.00010s</span></dd>
|
543
|
+
</dl>
|
544
|
+
</div>
|
545
|
+
<div id="div_group_30" class="example_group passed">
|
546
|
+
<dl style="margin-left: 60px;">
|
547
|
+
<dt id="example_group_30" class="passed">when converted to falling sand</dt>
|
548
|
+
<script type="text/javascript">moveProgressBar('75.9');</script>
|
549
|
+
<dd class="example passed"><span class="passed_spec_name">should be a kind of DiamondLang::Helpers::FallingSand</span><span class='duration'>0.00012s</span></dd>
|
550
|
+
<script type="text/javascript">moveProgressBar('77.2');</script>
|
551
|
+
<dd class="example passed"><span class="passed_spec_name">is a FallingSand entity</span><span class='duration'>0.00009s</span></dd>
|
552
|
+
<script type="text/javascript">moveProgressBar('78.4');</script>
|
553
|
+
<dd class="example passed"><span class="passed_spec_name">has a block id of stone</span><span class='duration'>0.00012s</span></dd>
|
554
|
+
<script type="text/javascript">moveProgressBar('79.7');</script>
|
555
|
+
<dd class="example passed"><span class="passed_spec_name">has a time of 1</span><span class='duration'>0.00017s</span></dd>
|
556
|
+
</dl>
|
557
|
+
</div>
|
558
|
+
<div id="div_group_31" class="example_group passed">
|
559
|
+
<dl style="margin-left: 45px;">
|
560
|
+
<dt id="example_group_31" class="passed">with an id of sand</dt>
|
561
|
+
<script type="text/javascript">moveProgressBar('81.0');</script>
|
562
|
+
<dd class="example passed"><span class="passed_spec_name">is sand</span><span class='duration'>0.00008s</span></dd>
|
563
|
+
<script type="text/javascript">moveProgressBar('82.2');</script>
|
564
|
+
<dd class="example passed"><span class="passed_spec_name">has a data value of 2</span><span class='duration'>0.00008s</span></dd>
|
565
|
+
<script type="text/javascript">moveProgressBar('83.5');</script>
|
566
|
+
<dd class="example passed"><span class="passed_spec_name">converts to a string</span><span class='duration'>0.00011s</span></dd>
|
567
|
+
<script type="text/javascript">moveProgressBar('84.8');</script>
|
568
|
+
<dd class="example passed"><span class="passed_spec_name">converts to a string with a replace method</span><span class='duration'>0.00010s</span></dd>
|
569
|
+
</dl>
|
570
|
+
</div>
|
571
|
+
<div id="div_group_32" class="example_group passed">
|
572
|
+
<dl style="margin-left: 60px;">
|
573
|
+
<dt id="example_group_32" class="passed">when converted to falling sand</dt>
|
574
|
+
<script type="text/javascript">moveProgressBar('86.0');</script>
|
575
|
+
<dd class="example passed"><span class="passed_spec_name">should be a kind of DiamondLang::Helpers::FallingSand</span><span class='duration'>0.00013s</span></dd>
|
576
|
+
<script type="text/javascript">moveProgressBar('87.3');</script>
|
577
|
+
<dd class="example passed"><span class="passed_spec_name">is a FallingSand entity</span><span class='duration'>0.00009s</span></dd>
|
578
|
+
<script type="text/javascript">moveProgressBar('88.6');</script>
|
579
|
+
<dd class="example passed"><span class="passed_spec_name">has a block id of stone</span><span class='duration'>0.00015s</span></dd>
|
580
|
+
<script type="text/javascript">moveProgressBar('89.8');</script>
|
581
|
+
<dd class="example passed"><span class="passed_spec_name">has a time of 1</span><span class='duration'>0.00009s</span></dd>
|
582
|
+
</dl>
|
583
|
+
</div>
|
584
|
+
<div id="div_group_33" class="example_group passed">
|
585
|
+
<dl style="margin-left: 45px;">
|
586
|
+
<dt id="example_group_33" class="passed">with an id of wood</dt>
|
587
|
+
<script type="text/javascript">moveProgressBar('91.1');</script>
|
588
|
+
<dd class="example passed"><span class="passed_spec_name">is wood</span><span class='duration'>0.00012s</span></dd>
|
589
|
+
<script type="text/javascript">moveProgressBar('92.4');</script>
|
590
|
+
<dd class="example passed"><span class="passed_spec_name">has a data value of 2</span><span class='duration'>0.00008s</span></dd>
|
591
|
+
<script type="text/javascript">moveProgressBar('93.6');</script>
|
592
|
+
<dd class="example passed"><span class="passed_spec_name">converts to a string</span><span class='duration'>0.00010s</span></dd>
|
593
|
+
<script type="text/javascript">moveProgressBar('94.9');</script>
|
594
|
+
<dd class="example passed"><span class="passed_spec_name">converts to a string with a replace method</span><span class='duration'>0.00012s</span></dd>
|
595
|
+
</dl>
|
596
|
+
</div>
|
597
|
+
<div id="div_group_34" class="example_group passed">
|
598
|
+
<dl style="margin-left: 60px;">
|
599
|
+
<dt id="example_group_34" class="passed">when converted to falling sand</dt>
|
600
|
+
<script type="text/javascript">moveProgressBar('96.2');</script>
|
601
|
+
<dd class="example passed"><span class="passed_spec_name">should be a kind of DiamondLang::Helpers::FallingSand</span><span class='duration'>0.00016s</span></dd>
|
602
|
+
<script type="text/javascript">moveProgressBar('97.4');</script>
|
603
|
+
<dd class="example passed"><span class="passed_spec_name">is a FallingSand entity</span><span class='duration'>0.00012s</span></dd>
|
604
|
+
<script type="text/javascript">moveProgressBar('98.7');</script>
|
605
|
+
<dd class="example passed"><span class="passed_spec_name">has a block id of stone</span><span class='duration'>0.00009s</span></dd>
|
606
|
+
<script type="text/javascript">moveProgressBar('100.0');</script>
|
607
|
+
<dd class="example passed"><span class="passed_spec_name">has a time of 1</span><span class='duration'>0.00009s</span></dd>
|
608
|
+
</dl>
|
609
|
+
</div>
|
610
|
+
<script type="text/javascript">document.getElementById('duration').innerHTML = "Finished in <strong>0.02457 seconds</strong>";</script>
|
611
|
+
<script type="text/javascript">document.getElementById('totals').innerHTML = "79 examples, 0 failures";</script>
|
612
|
+
</div>
|
613
|
+
</div>
|
614
|
+
</body>
|
615
|
+
</html>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: diamond-lang
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben (@penne12_)
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-12-
|
11
|
+
date: 2015-12-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: require_all
|
@@ -24,20 +24,6 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.3'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: shoulda
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - "~>"
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '3.5'
|
34
|
-
type: :development
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - "~>"
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '3.5'
|
41
27
|
- !ruby/object:Gem::Dependency
|
42
28
|
name: rdoc
|
43
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -94,6 +80,20 @@ dependencies:
|
|
94
80
|
- - "~>"
|
95
81
|
- !ruby/object:Gem::Version
|
96
82
|
version: '0.11'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rspec
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '3.4'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '3.4'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: pry
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -153,6 +153,7 @@ files:
|
|
153
153
|
- Rakefile
|
154
154
|
- VERSION
|
155
155
|
- diamond-lang.gemspec
|
156
|
+
- examples/conveyor.rb
|
156
157
|
- examples/hello_world.rb
|
157
158
|
- lib/diamond-lang.rb
|
158
159
|
- lib/diamond-lang/command_chain.rb
|
@@ -170,10 +171,14 @@ files:
|
|
170
171
|
- lib/diamond-lang/helpers/errors/too_small.rb
|
171
172
|
- lib/diamond-lang/helpers/falling_sand.rb
|
172
173
|
- lib/diamond-lang/helpers/target_selector.rb
|
173
|
-
- lib/diamond-lang/minecraft/commands/say.rb
|
174
174
|
- lib/diamond-lang/one_command.rb
|
175
|
-
-
|
176
|
-
-
|
175
|
+
- spec/errors/invalid_axis_spec.rb
|
176
|
+
- spec/errors/invalid_coordinate_value_spec.rb
|
177
|
+
- spec/errors/relative_cordinate_converted_to_argument_spec.rb
|
178
|
+
- spec/errors/too_small_spec.rb
|
179
|
+
- spec/helper.rb
|
180
|
+
- spec/helpers/block_spec.rb
|
181
|
+
- spec/index.html
|
177
182
|
homepage: http://bensites.com/diamond-lang/
|
178
183
|
licenses:
|
179
184
|
- MIT
|