taskpaper 0.1 → 0.1.1

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: c92d61085a02597bb8b163f1a3b0d20dcd27db42
4
- data.tar.gz: ee92243b2313b05739e764e0104989c1010895a2
3
+ metadata.gz: ee1de686302a96d1475920fc769515797a703f1f
4
+ data.tar.gz: 797d280c00be46ef2e83337411b7a3f53023bba7
5
5
  SHA512:
6
- metadata.gz: 2e58b2ad20b0b0834b2e14f607312614dbb8efd60dccf89d169509d87d1a97748d84fb1a8edee69e51ece3788f03587b65c30a95dcb29e7e7d75173ce50bba63
7
- data.tar.gz: 97e80112c4a11afff1525004dcf738390c0e2082e78d55e096d078c5280c6067ba79ed4cd9ba295f9d6ab00932fdc3b2c63938788e628ff33e1873853ac93d64
6
+ metadata.gz: 6b3b61d0ae2d95b8656efaf70d0beba2d15f3903d4c336374478f3a0986dd3b8ffd0818e0b4230b6d35c6b25dcb56a71244f79d34dc5bd6432f16b5b2d567567
7
+ data.tar.gz: 36922cb333a217241c86577eed13f3673c263253f5a60701aa50bc601a4effb454dea3f9dd77c2f4484eb6b37d8df1c3897fb5ac7410f5d73b85cacfb0d14845
data/CHANGELOG ADDED
@@ -0,0 +1,10 @@
1
+
2
+ 0.1.1
3
+ =====
4
+
5
+ - Taskpaper::Document.new takes a filepath or a string of taskpaper text.
6
+
7
+ 0.1
8
+ ===
9
+
10
+ - Initial version
data/LICENSE ADDED
@@ -0,0 +1,8 @@
1
+ The MIT License (MIT)
2
+ Copyright (c) 2016 Matthew Petty
3
+
4
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
5
+
6
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
7
+
8
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -1,11 +1,11 @@
1
1
  module Taskpaper
2
2
  class Document
3
3
 
4
- attr_accessor :filename, :doc
4
+ attr_accessor :filename, :doc, :text
5
5
 
6
6
  def parse
7
7
  @doc = []
8
- @text.each_line do |line|
8
+ text.each_line do |line|
9
9
  item = Taskpaper::Item.new line
10
10
  @doc << item.classify.new(line)
11
11
  end
@@ -13,14 +13,17 @@ module Taskpaper
13
13
  end
14
14
 
15
15
  #---------------------
16
- def initialize(file)
17
- @filename = file
18
- @text = File.open(filename, "r").read
16
+ def initialize(taskpaper)
17
+ if File.exists?(taskpaper)
18
+ @text = File.open(taskpaper, "r").read
19
+ else
20
+ @text = taskpaper
21
+ end
19
22
  parse
20
23
  end
21
24
 
22
25
  def to_text
23
- @text
26
+ text
24
27
  end
25
28
 
26
29
  def to_html
data/taskpaper.gemspec CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "taskpaper"
7
- spec.version = "0.1"
7
+ spec.version = "0.1.1"
8
8
  spec.authors = ["Matt Petty"]
9
9
  spec.email = ["matt@kizmeta.com"]
10
10
  spec.licenses = ['MIT']
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: taskpaper
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.1'
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Petty
@@ -45,7 +45,9 @@ executables: []
45
45
  extensions: []
46
46
  extra_rdoc_files: []
47
47
  files:
48
+ - CHANGELOG
48
49
  - Gemfile
50
+ - LICENSE
49
51
  - README.md
50
52
  - Rakefile
51
53
  - bin/console