elementic 0.7 → 0.8

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 (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/elementic.rb +22 -17
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c8748b5cc3e1ef741923a97dd10e25daf21b7f87
4
- data.tar.gz: a377ac7b07e690d38b91d2e14acd44910f315a12
3
+ metadata.gz: bfea991222c69eb763824f2b776da50d49af93da
4
+ data.tar.gz: 6d0a18c227d764def065212cb12c70c4c9bd98bf
5
5
  SHA512:
6
- metadata.gz: 43811a4c56c1567c286b13482fd13100f2b24138b1b3dabfb944ba2d20a993fc62fe77ba82f762971b2c732ab266a87053b6e7d93ddcd7c90c9cad6703fbbe6c
7
- data.tar.gz: 11c2aab10441f403945005d775756dc860465e7c4b6c84f305d32e407ac950433859b9ae78a58e11c6c0a134d5f2e8527f49fa8b70886d1849eba128423c65ad
6
+ metadata.gz: 838a94e02370493a66c45d4970add05e65e2b8b67bfcee923396a5c7e408d30b5e2803916b5ba238e9c7457af67dde799c4b1c969d0b4842da290df193044cf2
7
+ data.tar.gz: d93b50716d064844ad4c030ce112728c3a5a59119c106580f3f19c6d93bc535f9abc58bb13df89871fe3564bdd3f2e51538de849fcb8664399b912f54176ef17
data/lib/elementic.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
- VERSION = '0.7'
2
+ VERSION = '0.8'
3
3
 
4
4
  $elements = {
5
5
  'H' => 'Hydrogen',
@@ -161,23 +161,28 @@ end
161
161
  # Use the element? method to convert
162
162
  # all symbols into the element name
163
163
 
164
- # try getting this to work
164
+ # Try to get this working
165
165
 
166
- # def convert_all
167
- # input = self.capitalize
168
- # if input.element?
169
- # $new = input.split ' '
170
- # end
171
- # $new.each do |i|
172
- # $elements.each do |e|
173
- # if i == e
174
- # $new.gsub(i, e)
175
- # end
176
- # end
177
- # end
178
- # puts $new.join ' '
179
- # end
180
- # end
166
+ # **Not working yet:** You can also convert all of the
167
+ # symbols in a string to their actual name
168
+ # ```ruby
169
+ # 'Never put H in balloons'.convert_all # => 'Never put Hydrogen in balloons'
170
+ # 'K and As are not good to consume'.convert_all # => 'Potassium and Arsenic are not good to consume'
171
+ # ```
172
+
173
+ # def convert_all
174
+ # input = self.capitalize
175
+ # keys = $elements.keys
176
+ # if input.element?
177
+ # $new = input.split ' '
178
+ # keys.each do |k|
179
+ # if $new.include? k
180
+ # $new = $new.gsub(k, $elements[k])
181
+ # end
182
+ # end
183
+ # puts $new.join ' '
184
+ # end
185
+ # end
181
186
 
182
187
  # Create some methods for the Elementic class
183
188
  class Elementic
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: elementic
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.7'
4
+ version: '0.8'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josh