e_m_typographer 0.0.2 → 0.0.3

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/e_m_typographer.rb +3 -9
  3. metadata +4 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 663b3a0525fb295928ca40e754d8e3ffc5228508
4
- data.tar.gz: aac09b60d1a98458ddb7ca2a32a06a279e141d8e
3
+ metadata.gz: 447d945fbb0431822646bf10ee0308c1428bf0c9
4
+ data.tar.gz: 95d2d472ec3f8cd0a2bbfccdc92bcd3e81955fba
5
5
  SHA512:
6
- metadata.gz: f4f149e59a41bf74008a7860e8a487ea140c9f23a27b850b37c997aa689db12696a994353e686fce25fa0e56700b579de9ae87065f5bb91dd4cd534bbfbe23fe
7
- data.tar.gz: b04de42669eeb4d9ebdd05fa2f458b299aac67130e902ce921347aeb3230700b841a2643bc41bdf55b5a5b8e07ee12dc91d3cce2eeef81be0ef91339f140d922
6
+ metadata.gz: bb7290f6ba4a9d5d97112aa56eb51bf42cfa37712509e5f176a8a69163af59f25d7bcba9ca8578801090f3e549d600af68fbe15007a3f809bf25eeb602fac817
7
+ data.tar.gz: c291d436fb9a47502d533dd9e9f602af961b88d676e104b2c81612e8640b538109941214f35034d6aa4de778296ab7989a95f889eba6c89ba83fabf199502993
@@ -4,9 +4,8 @@ require 'json'
4
4
 
5
5
  class EMTypographer
6
6
  TYPOGRAPHER_REQUEST_URI = URI('http://mdash.ru/api.v1.php')
7
- attr_accessor :text
8
7
 
9
- def apply
8
+ def self.apply(text)
10
9
  response = send_typographer_post_request(text)
11
10
 
12
11
  JSON.parse(response.body)['result'] if response && response.body['result']
@@ -14,16 +13,11 @@ class EMTypographer
14
13
 
15
14
  private
16
15
 
17
- def send_typographer_post_request(text)
16
+ def self.send_typographer_post_request(text)
18
17
  return if text.empty?
19
18
 
20
19
  request = Net::HTTP.new(TYPOGRAPHER_REQUEST_URI.host, TYPOGRAPHER_REQUEST_URI.port)
21
- request.post(TYPOGRAPHER_REQUEST_URI.path, post_query)
22
- end
23
-
24
- def post_query
25
- "text=#{text}"
20
+ request.post(TYPOGRAPHER_REQUEST_URI.path, "text=#{text}")
26
21
  end
27
22
  end
28
23
 
29
-
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: e_m_typographer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anton Kolmakov
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-09-16 00:00:00.000000000 Z
12
+ date: 2014-09-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -39,7 +39,7 @@ dependencies:
39
39
  - - ">="
40
40
  - !ruby/object:Gem::Version
41
41
  version: '0'
42
- description: Allows you to format yout text using http://mdash.ru API.
42
+ description: Allows you to format your text using http://mdash.ru API.
43
43
  email:
44
44
  executables: []
45
45
  extensions: []
@@ -69,5 +69,5 @@ rubyforge_project:
69
69
  rubygems_version: 2.2.0
70
70
  signing_key:
71
71
  specification_version: 4
72
- summary: Allows you to format yout text using http://mdash.ru API.
72
+ summary: Allows you to format your text using http://mdash.ru API.
73
73
  test_files: []