writer 0.4.0 → 0.4.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +2 -0
- data/README.md +11 -1
- data/bin/setup +4 -0
- data/lib/writer/configuration.rb +1 -0
- data/lib/writer/version.rb +1 -1
- data/spec/creator_spec.rb +15 -15
- data/writer.gemspec +3 -2
- metadata +19 -18
- data/.ruby-gemset +0 -1
- data/.ruby-version +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9890015c4993cd40187cf56883e6dae69561f25c
|
4
|
+
data.tar.gz: 71a1b31d6d89e11cfb9f17139c890ff48fe335f7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0708044357ca77fe16c5fc555a61e54fb07efb159194c7e6b371688a2212198f06013db36ec6313ec78ee469e5c758e8259ba3805bc18457686c904bfaf79555
|
7
|
+
data.tar.gz: f0b0bf2445d488ba7ecf28bdafd127ab8892b4cfca350aeea40180ee12232f5cde346faf87153c8d1cd12d4a260e3df1eda0cf065dfa3b9ab6291cac073a8cff
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
# Writer
|
2
2
|
|
3
|
-
This gem adds a command line utility that writes a new file for you.
|
3
|
+
This gem adds a command line utility that writes a new file named after today's for you.
|
4
|
+
|
5
|
+
It's useful for keeping a private diary or writing a daily log for your job.
|
4
6
|
|
5
7
|
## Doesn't touch do that?
|
6
8
|
|
@@ -75,6 +77,14 @@ log_level: 2 # 0 - err, 1 - warn, 2 - info, 3 - debug
|
|
75
77
|
template_path: ''
|
76
78
|
```
|
77
79
|
|
80
|
+
## Development
|
81
|
+
|
82
|
+
```
|
83
|
+
git clone git@github.com:you/writer.git
|
84
|
+
cd writer
|
85
|
+
./bin/setup
|
86
|
+
```
|
87
|
+
|
78
88
|
## Contributing
|
79
89
|
|
80
90
|
Please provide a spec covering your feature or bug fix, thank you!
|
data/bin/setup
ADDED
data/lib/writer/configuration.rb
CHANGED
data/lib/writer/version.rb
CHANGED
data/spec/creator_spec.rb
CHANGED
@@ -2,39 +2,39 @@ require "writer/file_creator"
|
|
2
2
|
|
3
3
|
module Writer
|
4
4
|
describe FileCreator do
|
5
|
-
let(:file) {
|
6
|
-
let(:creator) { FileCreator.new }
|
5
|
+
let(:file) { double(:file) }
|
7
6
|
|
8
|
-
|
9
|
-
File.stub(:open)
|
10
|
-
.with('filename', 'w')
|
11
|
-
.and_yield(file)
|
7
|
+
subject(:creator) { described_class.new }
|
12
8
|
|
13
|
-
|
14
|
-
|
15
|
-
|
9
|
+
before :each do
|
10
|
+
allow(File).to receive(:open).with('filename', 'w').and_yield(file)
|
11
|
+
allow(File).to receive(:open).with('filename', 'r')
|
16
12
|
end
|
17
13
|
|
18
14
|
context "with content" do
|
19
15
|
it "writes the content" do
|
20
|
-
file.
|
16
|
+
allow(file).to receive(:puts)
|
17
|
+
|
21
18
|
creator.create!('filename', 'hi')
|
19
|
+
expect(file).to have_received(:puts).with('hi')
|
22
20
|
end
|
23
21
|
end
|
24
22
|
|
25
23
|
context "without content" do
|
26
24
|
it "leaves a blank line" do
|
27
|
-
creator.
|
28
|
-
file.
|
25
|
+
allow(creator).to receive(:template)
|
26
|
+
allow(file).to receive(:puts)
|
27
|
+
|
29
28
|
creator.create!('filename')
|
29
|
+
expect(file).to have_received(:puts).with(nil)
|
30
30
|
end
|
31
31
|
|
32
32
|
it "uses a template, if it exists" do
|
33
|
-
|
34
|
-
|
33
|
+
allow(creator).to receive(:template) { "hello\nworld" }
|
34
|
+
allow(file).to receive(:puts)
|
35
35
|
|
36
|
-
file.should_receive(:puts).with("hello\nworld")
|
37
36
|
creator.create!('filename')
|
37
|
+
expect(file).to have_received(:puts).with("hello\nworld")
|
38
38
|
end
|
39
39
|
end
|
40
40
|
end
|
data/writer.gemspec
CHANGED
@@ -13,9 +13,10 @@ Gem::Specification.new do |gem|
|
|
13
13
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
14
14
|
gem.name = "writer"
|
15
15
|
gem.require_paths = ["lib"]
|
16
|
+
gem.licenses = 'MIT'
|
16
17
|
gem.version = Writer::VERSION
|
17
18
|
|
18
|
-
gem.add_dependency 'activesupport'
|
19
|
+
gem.add_dependency 'activesupport', '~> 4.1'
|
19
20
|
|
20
|
-
gem.add_development_dependency 'rspec'
|
21
|
+
gem.add_development_dependency 'rspec', '~> 3.1'
|
21
22
|
end
|
metadata
CHANGED
@@ -1,59 +1,59 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: writer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.0
|
4
|
+
version: 0.4.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joe Sak
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-12-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '4.1'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '4.1'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rspec
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '3.1'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '3.1'
|
41
41
|
description: Easily start a new file to write in.
|
42
42
|
email:
|
43
43
|
- joe@joesak.com
|
44
44
|
executables:
|
45
|
+
- setup
|
45
46
|
- wr
|
46
47
|
extensions: []
|
47
48
|
extra_rdoc_files: []
|
48
49
|
files:
|
49
|
-
- .gitignore
|
50
|
-
- .rspec
|
51
|
-
- .ruby-gemset
|
52
|
-
- .ruby-version
|
50
|
+
- ".gitignore"
|
51
|
+
- ".rspec"
|
53
52
|
- Gemfile
|
54
53
|
- LICENSE
|
55
54
|
- README.md
|
56
55
|
- Rakefile
|
56
|
+
- bin/setup
|
57
57
|
- bin/wr
|
58
58
|
- config/writer.yml
|
59
59
|
- lib/writer.rb
|
@@ -69,7 +69,8 @@ files:
|
|
69
69
|
- spec/writer_spec.rb
|
70
70
|
- writer.gemspec
|
71
71
|
homepage: ''
|
72
|
-
licenses:
|
72
|
+
licenses:
|
73
|
+
- MIT
|
73
74
|
metadata: {}
|
74
75
|
post_install_message:
|
75
76
|
rdoc_options: []
|
@@ -77,17 +78,17 @@ require_paths:
|
|
77
78
|
- lib
|
78
79
|
required_ruby_version: !ruby/object:Gem::Requirement
|
79
80
|
requirements:
|
80
|
-
- -
|
81
|
+
- - ">="
|
81
82
|
- !ruby/object:Gem::Version
|
82
83
|
version: '0'
|
83
84
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
84
85
|
requirements:
|
85
|
-
- -
|
86
|
+
- - ">="
|
86
87
|
- !ruby/object:Gem::Version
|
87
88
|
version: '0'
|
88
89
|
requirements: []
|
89
90
|
rubyforge_project:
|
90
|
-
rubygems_version: 2.
|
91
|
+
rubygems_version: 2.4.4
|
91
92
|
signing_key:
|
92
93
|
specification_version: 4
|
93
94
|
summary: Start a new file and write in it.
|
data/.ruby-gemset
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
writer
|
data/.ruby-version
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
ruby-2.0.0
|