emoruby 0.0.1 โ†’ 0.0.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6ab9827dc3bc5757c6b5b6b48fcd052612ad0335
4
- data.tar.gz: 9e713b0d9d1bec3ab53287594a87422581334418
3
+ metadata.gz: 8437f52585aa5e235a4aeabc77778b7aecada629
4
+ data.tar.gz: a5888ca7dea71281b22813af3141e8173e3ea557
5
5
  SHA512:
6
- metadata.gz: 5710e95755df5bcf2870e32e64fcf420e7fd405586f4d42392f540dc330fa439121a71f193dcb2441dfc8d08dc17d2e912dedcfbd564ee10489e315788446aa1
7
- data.tar.gz: baab73de95107668beb4947e291a25d9e626cd9ba4489af13f5be7f19395fcd53a4b33dd77866f08692f13168bff65e28b9e4cdb2bffd90899069b56f6d19bf1
6
+ metadata.gz: 7dcae6112ec5222f8eadf02b63b01a12a00b5f2a0862ba0d9c3d0bd44057050c1e34d51e31dcf3666da57db2dc1e95b25ab5748551f9c8939850effd9ad67fc6
7
+ data.tar.gz: c88caca36a2681bbc062ace60cca8a5a13106e9ae0da4c5bb2bc1b780be578cef44197c04b685daa222152f2bf33613ca2f7387624373b363f42d8e15f35d012
@@ -0,0 +1,19 @@
1
+ # keywords
2
+ ๐Ÿ“‹: class
3
+ ๐Ÿ“ฆ: module
4
+ ๐Ÿ”œ: def
5
+ ๐Ÿ”š: end
6
+ ๐Ÿšฃ: self
7
+
8
+ # symbols
9
+ ๐Ÿ’ฌ: "\""
10
+ โ–ช๏ธ: "."
11
+ โ†ช๏ธ: "("
12
+ โ†ฉ๏ธ: ")"
13
+ โžฐ: ","
14
+
15
+ # conveniences
16
+ ๐Ÿ‘€: puts
17
+ ๐Ÿฃ: new
18
+ ๐Ÿ’ฅ: raise
19
+ โž•: +
@@ -1,16 +1,12 @@
1
1
  require 'emoji_data'
2
2
  require 'emoruby/util/string'
3
3
 
4
+ require 'yaml'
5
+ require 'pathname'
6
+
4
7
  module Emoruby
5
8
  class ConvertsEmojiToRuby
6
- TRANSLATIONS = {
7
- "clipboard" => "class",
8
- "soon" => "def",
9
- "eyes" => "puts",
10
- "speech_balloon" => "\"",
11
- "black_small_square" => ".",
12
- "hatching_chick" => "new"
13
- }
9
+ TRANSLATIONS = YAML.load(File.read(Pathname.new(File.dirname(__FILE__)).join("..","..","config","translations.yml")))
14
10
 
15
11
  GARBAGE = [
16
12
  [239,184,143] # evil problematic whitespace where is it from where am i what even
@@ -38,7 +34,7 @@ module Emoruby
38
34
 
39
35
  def emoji_name_for(char)
40
36
  return unless emoji = EmojiData.find_by_str(char).first
41
- TRANSLATIONS[emoji.short_name] || emoji.short_name
37
+ TRANSLATIONS[emoji.to_s] || emoji.short_name
42
38
  end
43
39
 
44
40
  def clean_chars(source)
@@ -1,3 +1,3 @@
1
1
  module Emoruby
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -3,13 +3,9 @@ require 'spec_helper'
3
3
  require 'emoruby'
4
4
 
5
5
  describe Emoruby do
6
- Given(:emo_path) { Pathname.pwd.join("spec","fixtures","#{file_name}.emoruby") }
7
- Given(:emo_source) { File.read(emo_path) }
8
- Given(:expected_ruby_path) { Pathname.pwd.join("spec","fixtures","#{file_name}.rb") }
9
- Given(:expected_ruby) { File.read(expected_ruby_path) }
10
-
11
6
  context "a hello world app" do
12
- Given(:file_name) { "1_hello_world" }
7
+ Given(:emo_source) { load_fixture("1_hello_world") }
8
+ Given(:expected_ruby) { load_fixture("1_hello_world","rb") }
13
9
 
14
10
  describe 'translating source' do
15
11
  When(:result) { Emoruby.emoji_to_ruby(emo_source) }
@@ -0,0 +1,5 @@
1
+ describe Emoruby do
2
+ Given(:source) { load_fixture("2_module_with_addition") }
3
+ When { Emoruby.eval(source) }
4
+ Then { Cool.chart(4,2) == 6 }
5
+ end
@@ -0,0 +1,5 @@
1
+ ๐Ÿ“ฆ ๐Ÿ†’
2
+ ๐Ÿ”œ ๐Ÿšฃโ–ช๏ธ๐Ÿ’นโ†ช๏ธ๐Ÿ…ฐโžฐ๐Ÿ…ฑโ†ฉ๏ธ
3
+ ๐Ÿ…ฐโž•๐Ÿ…ฑ
4
+ ๐Ÿ”š
5
+ ๐Ÿ”š
@@ -1,4 +1,5 @@
1
1
  require 'rspec/given'
2
+ require 'support/file_helpers'
2
3
 
3
4
  RSpec::Matchers.define :match_all_the_characters_of do |expected|
4
5
  match do |actual|
@@ -14,5 +15,9 @@ RSpec::Matchers.define :match_all_the_characters_of do |expected|
14
15
  end
15
16
  end
16
17
 
18
+ RSpec.configure do |c|
19
+ c.include FileHelpers
20
+ end
21
+
17
22
  # other junk
18
23
  require 'pry'
@@ -0,0 +1,7 @@
1
+ require 'pathname'
2
+
3
+ module FileHelpers
4
+ def load_fixture(name, type = "emoruby")
5
+ File.read(Pathname.pwd.join("spec","fixtures","#{name}.#{type}"))
6
+ end
7
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: emoruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Searls
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-21 00:00:00.000000000 Z
11
+ date: 2014-11-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: emoji_data
@@ -124,6 +124,7 @@ files:
124
124
  - README.md
125
125
  - Rakefile
126
126
  - bin/emoruby
127
+ - config/translations.yml
127
128
  - emoruby.gemspec
128
129
  - lib/emoruby.rb
129
130
  - lib/emoruby/converts_emoji_to_ruby.rb
@@ -132,9 +133,12 @@ files:
132
133
  - lib/emoruby/util/string.rb
133
134
  - lib/emoruby/version.rb
134
135
  - spec/1_hello_world_spec.rb
136
+ - spec/2_module_with_addition_spec.rb
135
137
  - spec/fixtures/1_hello_world.emoruby
136
138
  - spec/fixtures/1_hello_world.rb
139
+ - spec/fixtures/2_module_with_addition.emoruby
137
140
  - spec/spec_helper.rb
141
+ - spec/support/file_helpers.rb
138
142
  homepage: https://github.com/searls/emoruby
139
143
  licenses:
140
144
  - MIT
@@ -155,12 +159,15 @@ required_rubygems_version: !ruby/object:Gem::Requirement
155
159
  version: '0'
156
160
  requirements: []
157
161
  rubyforge_project:
158
- rubygems_version: 2.2.2
162
+ rubygems_version: 2.4.4
159
163
  signing_key:
160
164
  specification_version: 4
161
165
  summary: A little emoji language that compiles down to Ruby
162
166
  test_files:
163
167
  - spec/1_hello_world_spec.rb
168
+ - spec/2_module_with_addition_spec.rb
164
169
  - spec/fixtures/1_hello_world.emoruby
165
170
  - spec/fixtures/1_hello_world.rb
171
+ - spec/fixtures/2_module_with_addition.emoruby
166
172
  - spec/spec_helper.rb
173
+ - spec/support/file_helpers.rb