anagram_algo 1.03 → 2.0

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
  SHA256:
3
- metadata.gz: c2f90d41deba14833191e2ea52f6361db1835dff05c6f931cc2c662e2a32c270
4
- data.tar.gz: 0f70965b66ed8344bcc55d3dd8d1bd448ff4bacc6ffd39049b4b1df222d56b3c
3
+ metadata.gz: 41c0d6485a58d9db7e39f306eaf70d565f629e4f4d1333b076c24baec8a2b80d
4
+ data.tar.gz: '089af06db83ede39b90d57b19b9ce7387136a23443bb0941962018c4e3df5415'
5
5
  SHA512:
6
- metadata.gz: 2ffe09ff093ccf086f3d0cdb7993b0986fb16804392e3c47509d9bc02419f9e70aa0dbb78619e844e11f0736d506b17a5f0fec9a466e9da761cb27b81e0ff2ad
7
- data.tar.gz: f327ef10a44b637ec746817e11b35f496288e28f1aa1e1622aa52206d6924faecf42aa7686de565c10ac3bec14250b212609909f3ed383dfe9352268ba29430c
6
+ metadata.gz: 48b4153061e5dd25f9e9ff12554772814019c68ad35593de68d8186313f3fb081843df36f0ffea9f20151f9b3b9951f6eb257d6500ce3f305dbb7bcd669e2663
7
+ data.tar.gz: 2d555da9c8f398e453f012c3ad411b29e06cea81e4eedcf146c4ada3995da4b018287488938b6258a02b967757f3ad88a3c430af0514722eed4e76f645de791e
data/.rspec_status ADDED
@@ -0,0 +1,4 @@
1
+ example_id | status | run_time |
2
+ -------------------------------- | ------ | --------------- |
3
+ ./spec/anagram_algo_spec.rb[1:1] | passed | 0.00131 seconds |
4
+ ./spec/anagram_algo_spec.rb[1:2] | failed | 0.01274 seconds |
data/README.md CHANGED
@@ -5,7 +5,6 @@
5
5
 
6
6
  #### AnagramAlgo is a simple algorithm to find and return list of anagrams from your text input.
7
7
 
8
-
9
8
  ## Installation
10
9
 
11
10
  Add this line to your application's Gemfile:
@@ -24,7 +23,7 @@ Or install it yourself as:
24
23
 
25
24
  ## Usage
26
25
 
27
- ### 1) Add your text to a hash with `:text` symbol key, then pass the arguments to `AnagramAlgo.parse(args)` like the example below. If you don't pass any args, and just run `AnagramAlgo.parse` it will return sample data for testing.
26
+ 1) Add your text to a hash with `:text` symbol key, then pass the arguments to `AnagramAlgo.parse(args)` like the example below. If you don't pass any args, and just run `AnagramAlgo.parse` it will return sample data for testing.
28
27
 
29
28
  ```
30
29
  args = { text: "Can a rat eat tar? How big is the arc of that car door? Could you pass me the book just below your elbow? Does your state have a coffee taste test? That cider is so sour I cried. It's not good to study in a dusty room. Would you like to see that thing at night? My chin is almost an inch long. Grab something cool to brag about. Don't act like a cat in public, please. It was our Daisy, robed like a princess, but bored all day long. Let's save that vase for later. Can an angel glean upon us? I seriously got stressed from resisting those desserts. Do you ever fluster, or are you always restful? Do you prefer the smell of lemon or melon?" }
@@ -32,7 +31,8 @@ args = { text: "Can a rat eat tar? How big is the arc of that car door? Could yo
32
31
  anagram_hash = AnagramAlgo.parse(args)
33
32
  ```
34
33
 
35
- ### 2) The returned data will be in hash format like below:
34
+ 2) The returned data will be in hash format like below:
35
+
36
36
  You can access the data, like so: `anagram_hash[:results]` and `anagram_hash[:text]`
37
37
 
38
38
  ```
data/Rakefile CHANGED
@@ -27,7 +27,9 @@ end
27
27
  def run_anagram
28
28
  # args = {text: "Can a rat eat tar? How big is the arc of that car door? Could you pass me the book just below your elbow? Does your state have a coffee taste test?" }
29
29
 
30
- args = { text: "Can a rat eat tar? How big is the arc of that car door? Could you pass me the book just below your elbow? Does your state have a coffee taste test? That cider is so sour I cried. It's not good to study in a dusty room. Would you like to see that thing at night? My chin is almost an inch long. Grab something cool to brag about. Don't act like a cat in public, please. It was our Daisy, robed like a princess, but bored all day long. Let's save that vase for later. Can an angel glean upon us? I seriously got stressed from resisting those desserts. Do you ever fluster, or are you always restful? Do you prefer the smell of lemon or melon?" }
30
+ # args = { text: "Can a rat eat tar? How big is the arc of that car door? Could you pass me the book just below your elbow? Does your state have a coffee taste test? That cider is so sour I cried. It's not good to study in a dusty room. Would you like to see that thing at night? My chin is almost an inch long. Grab something cool to brag about. Don't act like a cat in public, please. It was our Daisy, robed like a princess, but bored all day long. Let's save that vase for later. Can an angel glean upon us? I seriously got stressed from resisting those desserts. Do you ever fluster, or are you always restful? Do you prefer the smell of lemon or melon?" }
31
+
32
+ args = {text: "Can a rat eat tar? How big is the arc of that car door? Could you pass me the book just below your elbow? Does your state have a coffee taste test?"}
31
33
 
32
34
  anagram_hash = AnagramAlgo.parse(args)
33
35
 
@@ -43,7 +43,7 @@ module AnagramAlgo
43
43
  duplicates = formatted_strs.select do |str|
44
44
  formatted_strs.count(str) > 1
45
45
  end
46
- duplicates.uniq
46
+ dups = duplicates.uniq
47
47
  end
48
48
 
49
49
  def format_string(string)
@@ -1,3 +1,3 @@
1
1
  module AnagramAlgo
2
- VERSION = "1.03"
2
+ VERSION = "2.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: anagram_algo
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.03'
4
+ version: '2.0'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Booth
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-07-06 00:00:00.000000000 Z
11
+ date: 2018-07-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -171,6 +171,7 @@ extra_rdoc_files: []
171
171
  files:
172
172
  - ".gitignore"
173
173
  - ".rspec"
174
+ - ".rspec_status"
174
175
  - ".travis.yml"
175
176
  - CODE_OF_CONDUCT.md
176
177
  - Gemfile