swifty 0.0.14 → 0.0.15

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/swifty.rb +1 -2
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 67c77340ca685c1925abcb020769941fa807a53c
4
- data.tar.gz: 22c0922842601a9e670606d1ffab6451da465d13
3
+ metadata.gz: f88bce0f7ad71b6583b4717728616180c19d1166
4
+ data.tar.gz: 3d6621155140d386832c8e3dc9c61af1c695056d
5
5
  SHA512:
6
- metadata.gz: e60566127d16029bc310477569f290054af669add0b0ac910abe8f69b3ddf34f3f55fe0d36cf253b9bbb60b6622ea24adadd50d14784bff85456af199e50e664
7
- data.tar.gz: a897b89cdfc46c104187783dad8de959d17e73cf3b196e367be86a7bf2f250cb190022ecc5720c1025e46cbe119e8a2d3a4534653cc404f1f3ef284958fcf170
6
+ metadata.gz: 87d9d995683a77ff021c754a70a311046c139d6da56188e664842f952202e5e74c10614f120476e3302538d761656ce93c0892512270c97aed1f6c455dbd71ac
7
+ data.tar.gz: f340f9e4e5f1d9c1075297c6d956498a1a9bc22962ba130ecfcc1c5ac77234ac380cb0543bc61c05494437de14a22c34a39554402ecb0ef4df283928a275bc17
@@ -4,8 +4,6 @@ require 'choice'
4
4
  require 'pp'
5
5
  require 'yaml'
6
6
 
7
- NoFile = Class.new(StandardError)
8
-
9
7
  Cmxl.config[:statement_separator] = /-\}/m
10
8
  Cmxl.config[:raise_line_format_errors] = true
11
9
 
@@ -44,6 +42,7 @@ module Swifty
44
42
  attr_reader :content, :options, :statement
45
43
 
46
44
  def initialize(content, **options)
45
+ content = File.read(content) if File.exists?(content)
47
46
  @options = options
48
47
  @content = content.is_a?(File) ? content.read : content
49
48
  @statement ||= Cmxl.parse(content, encoding: options[:encoding]).first
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: swifty
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.14
4
+ version: 0.0.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Emil Kampp