remoji 0.0.3 → 0.0.4

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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.adoc +49 -0
  3. data/lib/remoji.rb +8 -4
  4. metadata +2 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5a45eab5da19a5876b07d17ac60cbaade8a494001fbdc9dfdaf7e34e05c7725b
4
- data.tar.gz: 32e8b735bba8c8b7c27e2c39378d4ab432eef23c276aa08c35dc93ac5fe1f2c0
3
+ metadata.gz: 74817456ce2d26baccebce57c53339b3d9dcc405fc1a8770e6e9020f0de9073e
4
+ data.tar.gz: 22ab3af9b6f563787a19f247b496611d3cc90aba8dc80fb6a249e3dfae17746a
5
5
  SHA512:
6
- metadata.gz: e80a6a45c8dde1641995cbc0213a95033f03a8b5222472841e25bdce936ac648bae018e56af8b6249187811c53197d13ec43aa1ee0782ecacda1ebb99f8fe45d
7
- data.tar.gz: c1d3b232c4aa3db694367d1b5b8bcbf7840a814b5a11fbbf7a233602f5107f67d7bc016b0320c2768bc7b00f3b97f3c9ff49449f07ff91d7349204c5837dd563
6
+ metadata.gz: 9500ff5cd2bc30cbdea50b2c12d47eb3e2fc39c943ef90168cf64dace57bcdabead853373181b2bf4ca136435f1dcb35106a1af07dceda52fc638acf2d29ab6d
7
+ data.tar.gz: 27fb5187f7acaffcb383e8bdf7c7abcdf3864b5057e0085599e59df418e03bd7e0e77d772d399ba31552bfe16f13e9a26fd5ca0a8d851678d4806be38d70b47a
data/README.adoc ADDED
@@ -0,0 +1,49 @@
1
+ = Remoji
2
+ Doc Writer <tj@rubyists.com>
3
+ 2019-10-28
4
+ :toc:
5
+
6
+ Remoji is a simple emoji command line tool. It will search for and output emojis.
7
+
8
+ == Installation
9
+ ----
10
+ % gem i remoji
11
+ ----
12
+
13
+ == Usage
14
+
15
+ NOTE: The first time emj runs, it will offer to import an emoji database. You
16
+ must have internet access for this
17
+
18
+ ----
19
+ emj [options] EMOJI ANOTHER_EMOJI ...
20
+
21
+ Where EMOJI is an emoji name to search for
22
+ -c, --cat CAT Find matches in a category
23
+ -s, --subcat CAT Find matches in a subcategory
24
+ -n, --no-details Just print the emojis
25
+ --subs, --subcategories
26
+ --cats, --categories
27
+ -h, --help
28
+ ----
29
+
30
+ == Examples
31
+
32
+ Normal List
33
+
34
+ ----
35
+ % emj -c Animal cat
36
+ {
37
+ :"cat face" => "🐱"
38
+ }
39
+ {
40
+ :cat => "🐈"
41
+ }
42
+ ----
43
+
44
+ Without any metadata
45
+
46
+ ----
47
+ % emj -n -c Animal cat
48
+ 🐱 🐈
49
+ ----
data/lib/remoji.rb CHANGED
@@ -9,8 +9,6 @@ require 'pry'
9
9
  require 'nokogiri'
10
10
  require 'open-uri'
11
11
 
12
- require 'json'
13
-
14
12
  # The Remoji command
15
13
  class Remoji
16
14
  EMOJI_TABLE = 'http://unicode.org/emoji/charts/full-emoji-list.html'.freeze
@@ -66,13 +64,19 @@ class Remoji
66
64
  emoji_file.open('w+') { |f| f.puts JSON.pretty_generate(hash) }
67
65
  end
68
66
 
69
- attr_reader :emoji_file
70
67
  def initialize
71
- @emoji_file = Pathname('/tmp/emojis.json')
72
68
  @options = OpenStruct.new
73
69
  verify_cache!
74
70
  end
75
71
 
72
+ def emoji_file
73
+ return @emoji_file if @emoji_file
74
+
75
+ local = Pathname(ENV['HOME']).join('.local/remoji')
76
+ FileUtils.mkdir_p local.to_s unless local.exist?
77
+ @emoji_file = local.join('emojis.json')
78
+ end
79
+
76
80
  def verify_cache!
77
81
  return if emoji_file.exist?
78
82
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: remoji
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - tj@rubyists.com
@@ -60,6 +60,7 @@ extensions: []
60
60
  extra_rdoc_files: []
61
61
  files:
62
62
  - COPYING
63
+ - README.adoc
63
64
  - bin/emj
64
65
  - lib/remoji.rb
65
66
  homepage: