template-ruby-parser 0.1.7 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/code-ruby-parser.gemspec +3 -1
- data/lib/code-ruby-parser.rb +1 -7
- data/lib/template-ruby-parser.rb +1 -7
- data/template-ruby-parser.gemspec +3 -1
- metadata +18 -137
- data/.overcommit.yml +0 -4
- data/CHANGELOG.md +0 -31
- data/Gemfile +0 -5
- data/Gemfile.lock +0 -32
- data/bin/code-parser +0 -27
- data/bin/deploy +0 -16
- data/bin/format +0 -3
- data/bin/parse-docs +0 -6
- data/bin/template-parser +0 -27
- data/docs/class.code +0 -9
- data/docs/meetup.code +0 -14
- data/docs/precedence.code +0 -1
- data/docs/precedence.template +0 -35
- data/docs/rain.code +0 -23
- data/docs/slack.code +0 -17
- data/docs/stripe.code +0 -7
- data/docs/twitter.code +0 -7
- data/lib/code/parser/addition.rb +0 -13
- data/lib/code/parser/and_operator.rb +0 -13
- data/lib/code/parser/bitwise_and.rb +0 -13
- data/lib/code/parser/bitwise_or.rb +0 -13
- data/lib/code/parser/boolean.rb +0 -13
- data/lib/code/parser/call.rb +0 -183
- data/lib/code/parser/chained_call.rb +0 -41
- data/lib/code/parser/class.rb +0 -55
- data/lib/code/parser/code.rb +0 -20
- data/lib/code/parser/comments.rb +0 -46
- data/lib/code/parser/dictionnary.rb +0 -52
- data/lib/code/parser/equal.rb +0 -68
- data/lib/code/parser/equality.rb +0 -20
- data/lib/code/parser/error/syntax_error.rb +0 -36
- data/lib/code/parser/error.rb +0 -6
- data/lib/code/parser/function.rb +0 -118
- data/lib/code/parser/greater_than.rb +0 -13
- data/lib/code/parser/group.rb +0 -15
- data/lib/code/parser/if.rb +0 -81
- data/lib/code/parser/if_modifier.rb +0 -39
- data/lib/code/parser/list.rb +0 -20
- data/lib/code/parser/multiplication.rb +0 -13
- data/lib/code/parser/name.rb +0 -14
- data/lib/code/parser/negation.rb +0 -18
- data/lib/code/parser/not_keyword.rb +0 -26
- data/lib/code/parser/nothing.rb +0 -13
- data/lib/code/parser/number.rb +0 -39
- data/lib/code/parser/operation.rb +0 -65
- data/lib/code/parser/or_keyword.rb +0 -13
- data/lib/code/parser/or_operator.rb +0 -13
- data/lib/code/parser/power.rb +0 -33
- data/lib/code/parser/range.rb +0 -13
- data/lib/code/parser/rescue.rb +0 -38
- data/lib/code/parser/shift.rb +0 -13
- data/lib/code/parser/splat.rb +0 -35
- data/lib/code/parser/statement.rb +0 -9
- data/lib/code/parser/string.rb +0 -62
- data/lib/code/parser/ternary.rb +0 -73
- data/lib/code/parser/unary_minus.rb +0 -23
- data/lib/code/parser/while.rb +0 -36
- data/lib/code/parser.rb +0 -237
- data/lib/code.rb +0 -2
- data/lib/template/parser.rb +0 -32
- data/lib/template.rb +0 -2
- data/spec/code/parser/addition_spec.rb +0 -26
- data/spec/code/parser/and_operator_spec.rb +0 -26
- data/spec/code/parser/bitwise_and_spec.rb +0 -26
- data/spec/code/parser/bitwise_or_spec.rb +0 -26
- data/spec/code/parser/boolean_spec.rb +0 -13
- data/spec/code/parser/call_spec.rb +0 -52
- data/spec/code/parser/chained_call_spec.rb +0 -33
- data/spec/code/parser/class_spec.rb +0 -32
- data/spec/code/parser/code_spec.rb +0 -13
- data/spec/code/parser/dictionnary_spec.rb +0 -40
- data/spec/code/parser/equal_spec.rb +0 -42
- data/spec/code/parser/equality_spec.rb +0 -26
- data/spec/code/parser/function_spec.rb +0 -43
- data/spec/code/parser/greater_than_spec.rb +0 -26
- data/spec/code/parser/group_spec.rb +0 -13
- data/spec/code/parser/if_modifier_spec.rb +0 -26
- data/spec/code/parser/if_spec.rb +0 -39
- data/spec/code/parser/list_spec.rb +0 -27
- data/spec/code/parser/multiplication_spec.rb +0 -26
- data/spec/code/parser/negation_spec.rb +0 -13
- data/spec/code/parser/not_keyword_spec.rb +0 -21
- data/spec/code/parser/nothing_spec.rb +0 -20
- data/spec/code/parser/number_spec.rb +0 -24
- data/spec/code/parser/or_keyword_spec.rb +0 -26
- data/spec/code/parser/or_operator_spec.rb +0 -26
- data/spec/code/parser/power_spec.rb +0 -21
- data/spec/code/parser/range_spec.rb +0 -21
- data/spec/code/parser/rescue_spec.rb +0 -26
- data/spec/code/parser/shift_spec.rb +0 -26
- data/spec/code/parser/string_spec.rb +0 -28
- data/spec/code/parser/ternary_spec.rb +0 -26
- data/spec/code/parser/unary_minus_spec.rb +0 -21
- data/spec/code/parser/while_spec.rb +0 -32
- data/spec/code/parser_spec.rb +0 -13
- data/spec/spec_helper.rb +0 -6
- data/spec/template/parser_spec.rb +0 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b1b14cdc39b62b7a470fd501bc4adc6482dfe22629a6dec7e1f11fb9f67ad0a2
|
4
|
+
data.tar.gz: bbc0cd837b22a94bfa65ff3821e523c45be652f1bf6052742fae6bcd9f749f4d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f58032ea04e39847b856921a666bde6e8b7866f21f16f3f78ca47684504467342cdba6040a20a722cae5795daad923c4c77a37d2e2e04bfd916e4443f6e47c44
|
7
|
+
data.tar.gz: ed05a8fcbb59bc83365017d6b28252a7b9a90713de827cd5100a68a1a208061d1d18d29f6ba5ea91c8e308e3a98aeb7c1b30242a10f8d24502e97a73dca017f7
|
data/code-ruby-parser.gemspec
CHANGED
@@ -2,7 +2,7 @@ require_relative "lib/code-ruby-parser"
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = "code-ruby-parser"
|
5
|
-
s.version =
|
5
|
+
s.version = "0.2.0"
|
6
6
|
s.summary = "A parser for the Code programming language"
|
7
7
|
s.description =
|
8
8
|
"A parser for the Code programming language, like 1 + 1 and user.first_name"
|
@@ -13,4 +13,6 @@ Gem::Specification.new do |s|
|
|
13
13
|
s.require_paths = ["lib"]
|
14
14
|
s.homepage = "https://github.com/dorianmariefr/template-ruby-parser"
|
15
15
|
s.license = "MIT"
|
16
|
+
|
17
|
+
s.add_dependency "code-ruby", "~> 0"
|
16
18
|
end
|
data/lib/code-ruby-parser.rb
CHANGED
data/lib/template-ruby-parser.rb
CHANGED
@@ -2,7 +2,7 @@ require_relative "lib/template-ruby-parser"
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = "template-ruby-parser"
|
5
|
-
s.version =
|
5
|
+
s.version = "0.2.0"
|
6
6
|
s.summary = "A parser for the Template programming language"
|
7
7
|
s.description =
|
8
8
|
'Like "Hello {name}" with {name: "Dorian"} gives "Hello Dorian"'
|
@@ -13,4 +13,6 @@ Gem::Specification.new do |s|
|
|
13
13
|
s.require_paths = ["lib"]
|
14
14
|
s.homepage = "https://github.com/dorianmariefr/template-ruby-parser"
|
15
15
|
s.license = "MIT"
|
16
|
+
|
17
|
+
s.add_dependency "template-ruby", "~> 0"
|
16
18
|
end
|
metadata
CHANGED
@@ -1,15 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: template-ruby-parser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dorian Marié
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-11-
|
12
|
-
dependencies:
|
11
|
+
date: 2022-11-14 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: template-ruby
|
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'
|
13
27
|
description: 'Like "Hello {name}" with {name: "Dorian"} gives "Hello Dorian"'
|
14
28
|
email: dorian@dorianmarie.fr
|
15
29
|
executables: []
|
@@ -17,106 +31,9 @@ extensions: []
|
|
17
31
|
extra_rdoc_files: []
|
18
32
|
files:
|
19
33
|
- ".gitignore"
|
20
|
-
- ".overcommit.yml"
|
21
|
-
- CHANGELOG.md
|
22
|
-
- Gemfile
|
23
|
-
- Gemfile.lock
|
24
|
-
- bin/code-parser
|
25
|
-
- bin/deploy
|
26
|
-
- bin/format
|
27
|
-
- bin/parse-docs
|
28
|
-
- bin/template-parser
|
29
34
|
- code-ruby-parser.gemspec
|
30
|
-
- docs/class.code
|
31
|
-
- docs/meetup.code
|
32
|
-
- docs/precedence.code
|
33
|
-
- docs/precedence.template
|
34
|
-
- docs/rain.code
|
35
|
-
- docs/slack.code
|
36
|
-
- docs/stripe.code
|
37
|
-
- docs/twitter.code
|
38
35
|
- lib/code-ruby-parser.rb
|
39
|
-
- lib/code.rb
|
40
|
-
- lib/code/parser.rb
|
41
|
-
- lib/code/parser/addition.rb
|
42
|
-
- lib/code/parser/and_operator.rb
|
43
|
-
- lib/code/parser/bitwise_and.rb
|
44
|
-
- lib/code/parser/bitwise_or.rb
|
45
|
-
- lib/code/parser/boolean.rb
|
46
|
-
- lib/code/parser/call.rb
|
47
|
-
- lib/code/parser/chained_call.rb
|
48
|
-
- lib/code/parser/class.rb
|
49
|
-
- lib/code/parser/code.rb
|
50
|
-
- lib/code/parser/comments.rb
|
51
|
-
- lib/code/parser/dictionnary.rb
|
52
|
-
- lib/code/parser/equal.rb
|
53
|
-
- lib/code/parser/equality.rb
|
54
|
-
- lib/code/parser/error.rb
|
55
|
-
- lib/code/parser/error/syntax_error.rb
|
56
|
-
- lib/code/parser/function.rb
|
57
|
-
- lib/code/parser/greater_than.rb
|
58
|
-
- lib/code/parser/group.rb
|
59
|
-
- lib/code/parser/if.rb
|
60
|
-
- lib/code/parser/if_modifier.rb
|
61
|
-
- lib/code/parser/list.rb
|
62
|
-
- lib/code/parser/multiplication.rb
|
63
|
-
- lib/code/parser/name.rb
|
64
|
-
- lib/code/parser/negation.rb
|
65
|
-
- lib/code/parser/not_keyword.rb
|
66
|
-
- lib/code/parser/nothing.rb
|
67
|
-
- lib/code/parser/number.rb
|
68
|
-
- lib/code/parser/operation.rb
|
69
|
-
- lib/code/parser/or_keyword.rb
|
70
|
-
- lib/code/parser/or_operator.rb
|
71
|
-
- lib/code/parser/power.rb
|
72
|
-
- lib/code/parser/range.rb
|
73
|
-
- lib/code/parser/rescue.rb
|
74
|
-
- lib/code/parser/shift.rb
|
75
|
-
- lib/code/parser/splat.rb
|
76
|
-
- lib/code/parser/statement.rb
|
77
|
-
- lib/code/parser/string.rb
|
78
|
-
- lib/code/parser/ternary.rb
|
79
|
-
- lib/code/parser/unary_minus.rb
|
80
|
-
- lib/code/parser/while.rb
|
81
36
|
- lib/template-ruby-parser.rb
|
82
|
-
- lib/template.rb
|
83
|
-
- lib/template/parser.rb
|
84
|
-
- spec/code/parser/addition_spec.rb
|
85
|
-
- spec/code/parser/and_operator_spec.rb
|
86
|
-
- spec/code/parser/bitwise_and_spec.rb
|
87
|
-
- spec/code/parser/bitwise_or_spec.rb
|
88
|
-
- spec/code/parser/boolean_spec.rb
|
89
|
-
- spec/code/parser/call_spec.rb
|
90
|
-
- spec/code/parser/chained_call_spec.rb
|
91
|
-
- spec/code/parser/class_spec.rb
|
92
|
-
- spec/code/parser/code_spec.rb
|
93
|
-
- spec/code/parser/dictionnary_spec.rb
|
94
|
-
- spec/code/parser/equal_spec.rb
|
95
|
-
- spec/code/parser/equality_spec.rb
|
96
|
-
- spec/code/parser/function_spec.rb
|
97
|
-
- spec/code/parser/greater_than_spec.rb
|
98
|
-
- spec/code/parser/group_spec.rb
|
99
|
-
- spec/code/parser/if_modifier_spec.rb
|
100
|
-
- spec/code/parser/if_spec.rb
|
101
|
-
- spec/code/parser/list_spec.rb
|
102
|
-
- spec/code/parser/multiplication_spec.rb
|
103
|
-
- spec/code/parser/negation_spec.rb
|
104
|
-
- spec/code/parser/not_keyword_spec.rb
|
105
|
-
- spec/code/parser/nothing_spec.rb
|
106
|
-
- spec/code/parser/number_spec.rb
|
107
|
-
- spec/code/parser/or_keyword_spec.rb
|
108
|
-
- spec/code/parser/or_operator_spec.rb
|
109
|
-
- spec/code/parser/power_spec.rb
|
110
|
-
- spec/code/parser/range_spec.rb
|
111
|
-
- spec/code/parser/rescue_spec.rb
|
112
|
-
- spec/code/parser/shift_spec.rb
|
113
|
-
- spec/code/parser/string_spec.rb
|
114
|
-
- spec/code/parser/ternary_spec.rb
|
115
|
-
- spec/code/parser/unary_minus_spec.rb
|
116
|
-
- spec/code/parser/while_spec.rb
|
117
|
-
- spec/code/parser_spec.rb
|
118
|
-
- spec/spec_helper.rb
|
119
|
-
- spec/template/parser_spec.rb
|
120
37
|
- template-ruby-parser.gemspec
|
121
38
|
homepage: https://github.com/dorianmariefr/template-ruby-parser
|
122
39
|
licenses:
|
@@ -141,40 +58,4 @@ rubygems_version: 3.3.7
|
|
141
58
|
signing_key:
|
142
59
|
specification_version: 4
|
143
60
|
summary: A parser for the Template programming language
|
144
|
-
test_files:
|
145
|
-
- spec/code/parser/addition_spec.rb
|
146
|
-
- spec/code/parser/and_operator_spec.rb
|
147
|
-
- spec/code/parser/bitwise_and_spec.rb
|
148
|
-
- spec/code/parser/bitwise_or_spec.rb
|
149
|
-
- spec/code/parser/boolean_spec.rb
|
150
|
-
- spec/code/parser/call_spec.rb
|
151
|
-
- spec/code/parser/chained_call_spec.rb
|
152
|
-
- spec/code/parser/class_spec.rb
|
153
|
-
- spec/code/parser/code_spec.rb
|
154
|
-
- spec/code/parser/dictionnary_spec.rb
|
155
|
-
- spec/code/parser/equal_spec.rb
|
156
|
-
- spec/code/parser/equality_spec.rb
|
157
|
-
- spec/code/parser/function_spec.rb
|
158
|
-
- spec/code/parser/greater_than_spec.rb
|
159
|
-
- spec/code/parser/group_spec.rb
|
160
|
-
- spec/code/parser/if_modifier_spec.rb
|
161
|
-
- spec/code/parser/if_spec.rb
|
162
|
-
- spec/code/parser/list_spec.rb
|
163
|
-
- spec/code/parser/multiplication_spec.rb
|
164
|
-
- spec/code/parser/negation_spec.rb
|
165
|
-
- spec/code/parser/not_keyword_spec.rb
|
166
|
-
- spec/code/parser/nothing_spec.rb
|
167
|
-
- spec/code/parser/number_spec.rb
|
168
|
-
- spec/code/parser/or_keyword_spec.rb
|
169
|
-
- spec/code/parser/or_operator_spec.rb
|
170
|
-
- spec/code/parser/power_spec.rb
|
171
|
-
- spec/code/parser/range_spec.rb
|
172
|
-
- spec/code/parser/rescue_spec.rb
|
173
|
-
- spec/code/parser/shift_spec.rb
|
174
|
-
- spec/code/parser/string_spec.rb
|
175
|
-
- spec/code/parser/ternary_spec.rb
|
176
|
-
- spec/code/parser/unary_minus_spec.rb
|
177
|
-
- spec/code/parser/while_spec.rb
|
178
|
-
- spec/code/parser_spec.rb
|
179
|
-
- spec/spec_helper.rb
|
180
|
-
- spec/template/parser_spec.rb
|
61
|
+
test_files: []
|
data/.overcommit.yml
DELETED
data/CHANGELOG.md
DELETED
@@ -1,31 +0,0 @@
|
|
1
|
-
### 0.1.7 - November 13, 2022
|
2
|
-
|
3
|
-
- Fix parsing of `nothing`
|
4
|
-
|
5
|
-
### 0.1.6 - November 13, 2022
|
6
|
-
|
7
|
-
- Add missing operator from equal, e.g. a += 1, a = 2
|
8
|
-
|
9
|
-
### 0.1.5 - November 13, 2022
|
10
|
-
|
11
|
-
- Restrict equal to simplify
|
12
|
-
|
13
|
-
### 0.1.4 - November 13, 2022
|
14
|
-
|
15
|
-
- Fix a || b
|
16
|
-
|
17
|
-
### 0.1.3 - November 13, 2022
|
18
|
-
|
19
|
-
- Fix parsing &, *, **
|
20
|
-
|
21
|
-
### 0.1.2 - November 12, 2022
|
22
|
-
|
23
|
-
- Fix parsing `&:even?`
|
24
|
-
|
25
|
-
### 0.1.1 - November 12, 2022
|
26
|
-
|
27
|
-
- Fix `:even?` and `:update?` strings
|
28
|
-
|
29
|
-
### 0.1.0 - November 12, 2022
|
30
|
-
|
31
|
-
- Initial release
|
data/Gemfile
DELETED
data/Gemfile.lock
DELETED
@@ -1,32 +0,0 @@
|
|
1
|
-
GEM
|
2
|
-
remote: https://rubygems.org/
|
3
|
-
specs:
|
4
|
-
diff-lcs (1.5.0)
|
5
|
-
prettier_print (1.0.2)
|
6
|
-
profile (0.4.0)
|
7
|
-
rspec (3.12.0)
|
8
|
-
rspec-core (~> 3.12.0)
|
9
|
-
rspec-expectations (~> 3.12.0)
|
10
|
-
rspec-mocks (~> 3.12.0)
|
11
|
-
rspec-core (3.12.0)
|
12
|
-
rspec-support (~> 3.12.0)
|
13
|
-
rspec-expectations (3.12.0)
|
14
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
15
|
-
rspec-support (~> 3.12.0)
|
16
|
-
rspec-mocks (3.12.0)
|
17
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
18
|
-
rspec-support (~> 3.12.0)
|
19
|
-
rspec-support (3.12.0)
|
20
|
-
syntax_tree (4.3.0)
|
21
|
-
prettier_print (>= 1.0.2)
|
22
|
-
|
23
|
-
PLATFORMS
|
24
|
-
arm64-darwin-21
|
25
|
-
|
26
|
-
DEPENDENCIES
|
27
|
-
profile
|
28
|
-
rspec
|
29
|
-
syntax_tree
|
30
|
-
|
31
|
-
BUNDLED WITH
|
32
|
-
2.3.22
|
data/bin/code-parser
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require "optparse"
|
4
|
-
require_relative "../lib/code-ruby-parser"
|
5
|
-
require "json"
|
6
|
-
|
7
|
-
options = {}
|
8
|
-
|
9
|
-
OptionParser
|
10
|
-
.new do |opts|
|
11
|
-
opts.banner = "Usage: bin/code-parser [options]"
|
12
|
-
|
13
|
-
opts.on(
|
14
|
-
"-i INPUT",
|
15
|
-
"--input=INPUT",
|
16
|
-
"Input in the code language (String or File)"
|
17
|
-
) do |input|
|
18
|
-
input = File.read(input) if File.exists?(input)
|
19
|
-
|
20
|
-
options[:input] = input
|
21
|
-
end
|
22
|
-
end
|
23
|
-
.parse!
|
24
|
-
|
25
|
-
input = options.fetch(:input, "")
|
26
|
-
|
27
|
-
puts JSON.pretty_generate(::Code::Parser.parse(input))
|
data/bin/deploy
DELETED
data/bin/format
DELETED
data/bin/parse-docs
DELETED
data/bin/template-parser
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require "optparse"
|
4
|
-
require_relative "../lib/code-ruby-parser"
|
5
|
-
require "json"
|
6
|
-
|
7
|
-
options = {}
|
8
|
-
|
9
|
-
OptionParser
|
10
|
-
.new do |opts|
|
11
|
-
opts.banner = "Usage: bin/template-parser [options]"
|
12
|
-
|
13
|
-
opts.on(
|
14
|
-
"-i INPUT",
|
15
|
-
"--input=INPUT",
|
16
|
-
"Input in the code language (String or File)"
|
17
|
-
) do |input|
|
18
|
-
input = File.read(input) if File.exists?(input)
|
19
|
-
|
20
|
-
options[:input] = input
|
21
|
-
end
|
22
|
-
end
|
23
|
-
.parse!
|
24
|
-
|
25
|
-
input = options.fetch(:input, "")
|
26
|
-
|
27
|
-
puts JSON.pretty_generate(::Template::Parser.parse(input))
|
data/docs/class.code
DELETED
data/docs/meetup.code
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
url = fetch(:url) { "https://www.meetup.com/parisrb" }
|
2
|
-
response = HTTP.get(url)
|
3
|
-
times = response.css(".groupHome-eventsList-upcomingEvents time")
|
4
|
-
times = times.map(&:datetime).map do |time|
|
5
|
-
Time.from_epoch(time.to_integer)
|
6
|
-
end
|
7
|
-
|
8
|
-
times.each do |time|
|
9
|
-
if (1.day.from_now...(1.day.from_now + 1.hour)).include?(time)
|
10
|
-
Sms.send("Event in one day {url}")
|
11
|
-
elsif (2.hours.from_now...(1.hour.from_now)).include(time)
|
12
|
-
Sms.send("Event in two hours {url}")
|
13
|
-
end
|
14
|
-
end
|
data/docs/precedence.code
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
|
data/docs/precedence.template
DELETED
@@ -1,35 +0,0 @@
|
|
1
|
-
- Code
|
2
|
-
- Statement
|
3
|
-
- Class
|
4
|
-
- While
|
5
|
-
- If
|
6
|
-
- IfModifier
|
7
|
-
- OrKeyword
|
8
|
-
- NotKeyword
|
9
|
-
- Equal
|
10
|
-
- Rescue
|
11
|
-
- Ternary
|
12
|
-
- Range
|
13
|
-
- OrOperator
|
14
|
-
- AndOperator
|
15
|
-
- Equality
|
16
|
-
- GreaterThan
|
17
|
-
- BitwiseOr
|
18
|
-
- BitwiseAnd
|
19
|
-
- Shift
|
20
|
-
- Addition
|
21
|
-
- Multiplication
|
22
|
-
- UnaryMinus
|
23
|
-
- Power
|
24
|
-
- Negation
|
25
|
-
- Splat
|
26
|
-
- Function
|
27
|
-
- ChainedCall
|
28
|
-
- Dictionnary
|
29
|
-
- List
|
30
|
-
- String
|
31
|
-
- Number
|
32
|
-
- Boolean
|
33
|
-
- Nothing
|
34
|
-
- Group
|
35
|
-
- Call
|
data/docs/rain.code
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
paris = { latitude: 48.8566, longitude: 2.4022 }
|
2
|
-
latitude = fetch(:latitude) { paris.latitude }
|
3
|
-
longitude = fetch(:longitude) { paris.longitude }
|
4
|
-
duration = fetch(:duration) { 1.hour }
|
5
|
-
hour = duration.from_now.hour
|
6
|
-
|
7
|
-
response = HTTP.get(
|
8
|
-
"https://api.open-meteo.com/v1/forecast",
|
9
|
-
parameters: {
|
10
|
-
latitude: latitude,
|
11
|
-
longitude: longitude,
|
12
|
-
hourly: :precipitation
|
13
|
-
}
|
14
|
-
)
|
15
|
-
|
16
|
-
precipitation = response.hourly.precipitation[hour]
|
17
|
-
precipitation = (precipitation * 100).to_integer
|
18
|
-
|
19
|
-
if precipitation > 0
|
20
|
-
Sms.send(
|
21
|
-
"There will be {precipitation}% of precipitation in the next hour"
|
22
|
-
)
|
23
|
-
end
|
data/docs/slack.code
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
Slack.send("Who is leading the syncs?", channel: "#team-template")
|
2
|
-
|
3
|
-
Twitter.send("What do you want to do this week?")
|
4
|
-
|
5
|
-
Discord.send("Who will be the game master this week?")
|
6
|
-
|
7
|
-
Email.send(
|
8
|
-
subject: "What did you do last week?",
|
9
|
-
from: "dorian@thoughtbot.com",
|
10
|
-
reply_to: "rob@thoughtbot.com"
|
11
|
-
)
|
12
|
-
|
13
|
-
Email.send(
|
14
|
-
subject: "What do you want to do this week?",
|
15
|
-
from: "dorian@thoughtbot.com",
|
16
|
-
reply_to: "rob@thoughtbot.com"
|
17
|
-
)
|
data/docs/stripe.code
DELETED
data/docs/twitter.code
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
twitter_username = fetch(:twitter_username) { "dorianmariefr" }
|
2
|
-
|
3
|
-
Twitter.search("to:{twitter_username}", type: :recent).each do |tweet|
|
4
|
-
next if Storage.exists?(tweet.id)
|
5
|
-
Storage.create!(tweet.id)
|
6
|
-
Sms.send("New mention: {tweet.user.screen_name}: {tweet.text}")
|
7
|
-
end
|
data/lib/code/parser/addition.rb
DELETED