general 1.3.0 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/gio.rb +13 -4
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c8069e0ce29ba1633760f2ddcf5ad50e7dbfb007
4
- data.tar.gz: bd9199ea2c9b5ee9622466672c8282cc8f14e88b
3
+ metadata.gz: ca9ebfe83430fa6d71009c18efe523203f06d1cf
4
+ data.tar.gz: 184093b86de685cc61ee89592c210c68abfc26d9
5
5
  SHA512:
6
- metadata.gz: 7519b19cf990fd5ddeff22eaca88233396a1130ad56bf78573965cc64cbe6932046c8a588075c5d9a6695dcd7235dd56b69b71091007480853ef951d02950bb9
7
- data.tar.gz: c3837725bbe8a263debe367d500f9e60ef0f984edbe3576e01187ec0cd2783a603851f9dee4b6fe10ecdfa4bc32578eeed5768fafa3c3cfbd5ac612f76a62b82
6
+ metadata.gz: cffd672f5d65cf8c71c9498c1095085f7377b10e9d51ea77321caa50c539d05644e238a106fad5781a61b468b9f1c05eb178f86855b7c208d5803b0bab6d08a9
7
+ data.tar.gz: 20f2a769d5b582fe47eab9a2bda3fc2006f235c897c27a9ac0dca166451bb280eada55b23700d33171d05fcab1426087b256ceafbef5e16080979bc44cb70a1b
data/lib/gio.rb CHANGED
@@ -29,16 +29,25 @@ module General
29
29
  # The general file extension
30
30
  EXTENSION = ".general"
31
31
 
32
+ # Public read source
33
+ attr :source
34
+
32
35
  # Loads a GIO from a file with the given path
33
36
  #
34
37
  # Parameter: path - the path of the file to load
35
38
  #
36
39
  # Return: GIO loaded from the file
37
40
  def self.load path
38
- file = File.new path
39
- gio = self.new file.read
40
- file.close
41
- return gio
41
+ self.new IO.read(path), path
42
+ end
43
+
44
+ # Creates a GIO with the given template string and source filename
45
+ #
46
+ # Parameter: string - the string being converted to a template
47
+ # Parameter: source - the name of the source file of the template
48
+ def initialize string, source=nil
49
+ super string
50
+ @source = source
42
51
  end
43
52
 
44
53
  # Writes the template with the given
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: general
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anshul Kharbanda
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-07-10 00:00:00.000000000 Z
11
+ date: 2016-07-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec