the_great_escape 0.1.0 → 0.1.03

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: 2a0943d518495527937a0ef408fc8e6a04ceb421
4
- data.tar.gz: 4cf7908c808f16455bb0133148e96103c2ffb5db
3
+ metadata.gz: 7e75689468950eda885a5aed37c8fc56cd1f40cd
4
+ data.tar.gz: 6ca487bc62ee3a9e50b3c7c1d9cce02a4a652a34
5
5
  SHA512:
6
- metadata.gz: 7871d5212d6cb67f6f9d3495e01f7eb508fce0baeafac607133c09328c1c0fe5eb9803bf384ecf810fcf8c38fc980c0558a4f34359150cf587c4576c873d5597
7
- data.tar.gz: 8c207b8d6baafffc6e0e1e19af890dcc4795437cde7390fb5b7341a1413cf13b8fbe16ccb059e24380fc9d8a2e7e03cd960ab552c1ad4e1643d7e15985a81c62
6
+ metadata.gz: a020e8b4f6f89dc1ad27234f210bcbb550a83aa365957f56c08962c8a04d254df09b26a2ba714a313768099c709201f604c48fa830489941a8c98d2afc3a77aa
7
+ data.tar.gz: 96193a1b0ceefe7dd067eeb660b40247a3d5d37165b5666347499723c72a53fec8c3f2650f6e9f3c9d7a7415d35c644c05fa721baaa6878094437ad7ed24f2a6
data/.gitignore CHANGED
@@ -8,3 +8,5 @@
8
8
  /spec/reports/
9
9
  /tmp/
10
10
  *.sw*
11
+ the_great_escape-*.gem
12
+ *.md.html
data/README.md CHANGED
@@ -2,28 +2,24 @@
2
2
  My first gem, the great escape. Seeing if your string contains SGR or other ASCII codes can be tricky, as when you print them to the screen they change the color/formatting of your terminal whether you want them to our not! Dumping results in more characters you have to either escape or sift through by eye. All the_great_escape does is escape strings that contain special sequences such as SGR parameters.
3
3
 
4
4
  # Installation
5
- 1. Add this line to your application's Gemfile:
6
-
5
+ * Add this line to your application's Gemfile:
7
6
  ```ruby
8
7
  gem 'the_great_escape'
9
8
  ```
10
-
11
- 1. cd into your project's root:
9
+ * cd into your project's root:
12
10
  ```
13
11
  $ cd my_project
14
12
  ```
15
- 1. execute:
13
+ * execute:
16
14
  ```
17
15
  $ bundle install
18
16
  ```
19
17
  ## Usage
20
-
21
- 1. Require the_great_escape at the top of the file
18
+ * Require the_great_escape at the top of the file
22
19
  ```ruby
23
20
  require 'the_great_escape'
24
21
  ```
25
-
26
- 1. And now use!
22
+ * And now use!
27
23
  ```ruby
28
24
  require 'the_great_escape'
29
25
 
@@ -47,10 +43,10 @@ puts string.scan /\\e\[\d+m$/ # ["\\e[31m"] scan returns the SGR code at the end
47
43
  puts "\e[0" # reset your terminal to its default style if you run this code.
48
44
  ```
49
45
  ## Methods:
50
- Method | Arguments | Example Usage | Description
51
- ------- | ----------- | ------------ | -
52
- escape | string | escaped = escape "hell \e[31m" |escapes the string passed to it so it can be safely printed later. Does not invalidate the string
53
- escape_puts | string | escape_putis "hell \e[31m" | escapes the string passed to it and prints it immediately to the console
46
+ | Method | Example Usage | Description |
47
+ | ------------- | ---------------------- | --- |
48
+ | escape STRING | escaped = escape "hell \e[31m" | escapes the string passed to it so it can be safely printed later. Does not invalidate the string |
49
+ | escape_puts STRING | escape_puts "hell \e[31m" | escapes the string passed to it and prints it immediately to the console |
54
50
 
55
51
  # Contributing
56
52
  Okay, I'm pretty new to Ruby and utterly new to git so I've created this to learn about string escapement, git collaboration and how to package, release and install gems. Regardless, to contribute:
@@ -5,7 +5,7 @@ module TheGreatEscape
5
5
  end
6
6
 
7
7
  def escape string
8
- string.dump.gsub /"/, ''
8
+ string.to_s.dump.gsub /"/, ''
9
9
  end
10
10
  end
11
11
  end
@@ -1,3 +1,3 @@
1
1
  module TheGreatEscape
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.03"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: the_great_escape
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.03
5
5
  platform: ruby
6
6
  authors:
7
7
  - jaytarka
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-08-11 00:00:00.000000000 Z
11
+ date: 2015-10-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler