semantic_linefeeds 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: edc9aa0ab2ce73fe2a8fd2b431df3bd0b17a541b
4
- data.tar.gz: bf4d399a6d34d318a5dcf2e4cfcb2851c39de48c
3
+ metadata.gz: 9a2e3ae8e3a4cde6618c4b0b2c5e3bae2b6a53d3
4
+ data.tar.gz: 11cfc36682b0aff77e3e7985f5ed732d018b33e2
5
5
  SHA512:
6
- metadata.gz: 2182223bacca0317033c3731532a059d2f947296035e820521d81584d7fdc6187dff3bc35a74659ed29cc9f899bde4db48a0a593a53a58a8eda27c179e832f9c
7
- data.tar.gz: 1be05cd06119022376aef2d45380ebbbff98111f9848e6407bd2b6fe782c598cbe19885fb3090f631538c68f8111f817ded8e290013830641c5d1b02f38a719c
6
+ metadata.gz: f17405fd1a752b74f5b486c9dbe6c05ee0b36551960228906fbd7cd9a7adeac103cf0446821ac96da9b10194a605d780da54720b770f9b7c71d9d83a655c4aec
7
+ data.tar.gz: 3a3ace871343efbdb7159de23616c40e27ae945279c1f87f25cde59357a5252ec7d967e9e3353273fc4ed2d6ff744587c9a60db282238e947dfb600745a61796
data/.rubocop.yml CHANGED
@@ -114,7 +114,7 @@ Style/StringLiteralsInInterpolation:
114
114
  SupportedStyles:
115
115
  - single_quotes
116
116
  - double_quotes
117
- Style/TrailingComma:
117
+ Style/TrailingCommaInLiteral:
118
118
  Description: Checks for trailing comma in parameter lists and literals.
119
119
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas
120
120
  Enabled: false
@@ -1,24 +1,27 @@
1
1
  module SemanticLinefeeds
2
2
  class CLI
3
3
  def initialize(args)
4
- if File.exist?(args[0])
5
- input = File.read(args[0])
6
- else
7
- input = string_from_args(args)
8
- end
9
-
4
+ @args = args
10
5
  puts Converter.run(input)
11
6
  end
12
7
 
13
8
  private
14
9
 
10
+ def input
11
+ if File.exist?(@args[0])
12
+ File.read(@args[0])
13
+ else
14
+ string_from_args
15
+ end
16
+ end
17
+
15
18
  # If the user passes the string in surrounded by quotes, return that string.
16
19
  # Else, if they don't, we'll join all the args into a string.
17
- def string_from_args(args)
18
- if args.is_a?(Array)
19
- args.join(" ")
20
+ def string_from_args
21
+ if @args.is_a?(Array)
22
+ @args.join(" ")
20
23
  else
21
- args
24
+ @args
22
25
  end
23
26
  end
24
27
  end
@@ -11,13 +11,13 @@ module SemanticLinefeeds
11
11
  !
12
12
  )
13
13
  \]
14
- ]
14
+ ].freeze
15
15
 
16
16
  SPLIT_BEFORE = %w[
17
17
  (
18
18
  \[
19
19
  http
20
- ]
20
+ ].freeze
21
21
 
22
22
  def self.run(text)
23
23
  SPLIT_BEFORE.each do |splitter|
@@ -1,3 +1,3 @@
1
1
  module SemanticLinefeeds
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: semantic_linefeeds
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Collins