cosi-temp 1.0.0

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: a6a7858970a217b101fd97c649a95fbc632a99ad
4
+ data.tar.gz: ca6ea75a03d26d49fa86b03dda7f364062fac871
5
+ SHA512:
6
+ metadata.gz: d6ccde06e05e9cb8a857b4f457bc50bf6cf903381c274eba508b96aed13361f3ddc8d59af3da9415141933caed74348f6f335011ecebe1ba317b945761e5e990
7
+ data.tar.gz: 41f54abbbd44b3a02499ff8b3250c9ab28cc92494f79632ee7816d6751da22549fae0ab74cc0b62bb85f45d8a669a71558ba4907459c9acfb92386f30c1c82b0
data/.gitignore ADDED
@@ -0,0 +1,2 @@
1
+ pkg
2
+ Tools.md
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --color
2
+ --require spec_helper
3
+ --format Fivemat
data/.travis.yml ADDED
@@ -0,0 +1,10 @@
1
+ language: ruby
2
+
3
+ rvm:
4
+ - 2.1
5
+ - 2.2.0
6
+ - 2.2.4
7
+ - 2.3.0
8
+
9
+ script: bundle exec rake spec
10
+ sudo: false
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source 'https://rubygems.org'
2
+ gemspec
3
+ gem 'fivemat'
data/Gemfile.lock ADDED
@@ -0,0 +1,37 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ cosi-temp (0.1.0)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ diff-lcs (1.2.5)
10
+ fivemat (1.3.2)
11
+ rake (10.4.2)
12
+ rspec (3.4.0)
13
+ rspec-core (~> 3.4.0)
14
+ rspec-expectations (~> 3.4.0)
15
+ rspec-mocks (~> 3.4.0)
16
+ rspec-core (3.4.1)
17
+ rspec-support (~> 3.4.0)
18
+ rspec-expectations (3.4.0)
19
+ diff-lcs (>= 1.2.0, < 2.0)
20
+ rspec-support (~> 3.4.0)
21
+ rspec-mocks (3.4.0)
22
+ diff-lcs (>= 1.2.0, < 2.0)
23
+ rspec-support (~> 3.4.0)
24
+ rspec-support (3.4.1)
25
+
26
+ PLATFORMS
27
+ ruby
28
+
29
+ DEPENDENCIES
30
+ bundler (~> 1.3)
31
+ cosi-temp!
32
+ fivemat
33
+ rake
34
+ rspec
35
+
36
+ BUNDLED WITH
37
+ 1.11.2
data/LICENSE ADDED
@@ -0,0 +1,14 @@
1
+ Copyright (c) 2015 Benjamin Lannon
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files
4
+ (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish,
5
+ distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to
6
+ the following conditions:
7
+
8
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
9
+
10
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
11
+ THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
12
+ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
13
+ CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
14
+ DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,21 @@
1
+ # Cosi-Temp
2
+
3
+ [![Build Status](https://travis-ci.org/lannonbr/cosi-temp.svg?branch=master)](https://travis-ci.org/lannonbr/cosi-temp)
4
+ [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/lannonbr/cosi-temp/master/LICENSE)
5
+
6
+ ### Note: The project is does not have an initial release yet
7
+
8
+ cosi-temp is a simple CLI tool for the [cosi-lab](https://github.com/cosi-lab) that is in
9
+ development. It will allow easy creation of a blank [meeting minutes](http://cosi-lab.github.io/meeting-minutes)
10
+ entry or [Project updates](http://cosi-lab.github.io/project-updates) post.
11
+
12
+ ## Installation
13
+ Make sure you have Ruby installed
14
+
15
+ The gem can easily be installed by typing in `gem install cosi-temp`
16
+
17
+ ## Usage
18
+ When complete, the commands needed include
19
+
20
+ - `cosi-temp meeting`: This will create a meeting minutes entry in the current directory with the current date used.
21
+ - `cosi-temp project -name "Foobar Release 1.4.0" -author "Benjamin Lannon"`: This will create a project updates post that has a header which is filled out using the -name and -author flags.
data/Rakefile ADDED
@@ -0,0 +1,8 @@
1
+ require 'bundler'
2
+ Bundler::GemHelper.install_tasks
3
+
4
+ require 'rspec/core/rake_task'
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ task :default => :spec
data/bin/cosi-temp ADDED
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ require 'cosi-temp'
3
+
4
+ CosiTemp.new
data/cosi-temp.gemspec ADDED
@@ -0,0 +1,19 @@
1
+ Gem::Specification.new do |s|
2
+ s.name = 'cosi-temp'
3
+ s.version = '1.0.0'
4
+ s.date = '2015-12-29'
5
+ s.summary = "Cosi Temp"
6
+ s.description = "A simple CLI tool to create a Project Update post or Meeting Minutes entry for the Clarkson Open Source Institute"
7
+ s.authors = ["Benjamin Lannon"]
8
+ s.email = 'brlannon118@gmail.com'
9
+ s.homepage = 'https://github.com/lannonbr/cosi-temp'
10
+ s.license = 'MIT'
11
+
12
+ s.files = `git ls-files`.split($\)
13
+ s.executables = ["cosi-temp"]
14
+ s.require_paths = ["lib"]
15
+
16
+ s.add_development_dependency 'bundler', '~> 1.3'
17
+ s.add_development_dependency 'rake'
18
+ s.add_development_dependency 'rspec'
19
+ end
@@ -0,0 +1,13 @@
1
+ # Forum
2
+
3
+ ---
4
+
5
+ # Lightning Talks
6
+
7
+ ---
8
+
9
+ # Project Updates / Announcements
10
+
11
+ ---
12
+
13
+ # After Meeting Slot
@@ -0,0 +1,19 @@
1
+ ---
2
+ layout: post
3
+ title: "Meeting Minutes: December 4"
4
+ categories: minutes
5
+ ---
6
+
7
+ # Forum
8
+
9
+ ---
10
+
11
+ # Lightning Talks
12
+
13
+ ---
14
+
15
+ # Project Updates / Announcements
16
+
17
+ ---
18
+
19
+ # After Meeting Slot
@@ -0,0 +1,5 @@
1
+ ---
2
+ layout: post
3
+ title: Update on Foobar
4
+ author: Benjamin Lannon
5
+ ---
data/lib/cosi-temp.rb ADDED
@@ -0,0 +1,19 @@
1
+ require 'cosi-temp/temp-generator'
2
+ require 'cosi-temp/meetings-generator'
3
+ require 'cosi-temp/projects-generator'
4
+
5
+ class CosiTemp
6
+ def initialize
7
+ if ARGV[0].downcase == "meeting"
8
+ puts "Making a meeting temp"
9
+ meeting = MeetingsGenerator.new(Date.today)
10
+ meeting.to_file
11
+ elsif ARGV[0].downcase == "project"
12
+ puts "Making a project temp"
13
+ author = ARGV[ARGV.find_index("-author")+1]
14
+ title = ARGV[ARGV.find_index("-name")+1]
15
+ project = ProjectsGenerator.new(author, title, Date.today)
16
+ project.to_file
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,46 @@
1
+ require 'date'
2
+
3
+ class MeetingsGenerator < TempGenerator
4
+ def initialize(date)
5
+ super(date)
6
+ @filename = gen_date
7
+ @title = gen_title
8
+ @file_array = create_file
9
+ end
10
+
11
+ def to_file
12
+ if File.exist? @filename
13
+ puts "The file already exists. Quitting"
14
+ return
15
+ end
16
+ File.open(@filename, 'w') do |f|
17
+ @file_array.each { |line| f.write line }
18
+ end
19
+ puts "File written to #{@filename}"
20
+ end
21
+
22
+ private
23
+
24
+ def gen_date
25
+ "#{@date.strftime('%Y-%m-%d')}-Meeting-Minutes.md"
26
+ end
27
+
28
+ def gen_title
29
+ "Meeting Minutes: #{@date.strftime('%B %-d')}"
30
+ end
31
+
32
+ def create_file
33
+ array = []
34
+ File.open(File.expand_path("../../../data/meetingstemp.md", __FILE__)) do |f|
35
+ array = f.readlines
36
+ array.unshift "\n"
37
+ array.unshift "---\n"
38
+ array.unshift "categories: minutes\n"
39
+ array.unshift "title: \"#{@title}\"\n"
40
+ array.unshift "layout: post\n"
41
+ array.unshift "---\n"
42
+ end
43
+
44
+ array
45
+ end
46
+ end
@@ -0,0 +1,38 @@
1
+ class ProjectsGenerator < TempGenerator
2
+ attr_accessor :author
3
+
4
+ def initialize(author, title, date)
5
+ super(date)
6
+ @title = title
7
+ @filename = gen_filename
8
+ @author = author
9
+ @file_array = create_file
10
+ end
11
+
12
+ def to_file
13
+ if File.exist? @filename
14
+ puts "The file already exists. Quitting"
15
+ return
16
+ end
17
+ File.open(@filename, 'w') do |f|
18
+ @file_array.each { |line| f.write line }
19
+ end
20
+ puts "File written to #{@filename}"
21
+ end
22
+
23
+ private
24
+
25
+ def gen_filename
26
+ "#{@date.strftime('%Y-%m-%d')}-#{@title.split.map{|word| word.downcase}.join('-')}.md"
27
+ end
28
+
29
+ def create_file
30
+ array = ["---\n",
31
+ "layout: post\n",
32
+ "title: #{@title}\n",
33
+ "author: #{@author}\n",
34
+ "---\n"]
35
+
36
+ array
37
+ end
38
+ end
@@ -0,0 +1,7 @@
1
+ class TempGenerator
2
+ attr_reader :date, :filename, :title, :file_array
3
+
4
+ def initialize(date)
5
+ @date = date
6
+ end
7
+ end
@@ -0,0 +1,52 @@
1
+ require 'spec_helper'
2
+
3
+ RSpec.describe MeetingsGenerator do
4
+ let(:date) { Date.parse("2015-12-04") }
5
+
6
+ before(:each) do
7
+ @meeting = MeetingsGenerator.new(date)
8
+ end
9
+
10
+ it "has the passed in date" do
11
+ expect(@meeting.date).to eq date
12
+ end
13
+
14
+ it "creates the name of the file" do
15
+ expect(@meeting.filename).to eq "2015-12-04-Meeting-Minutes.md"
16
+ end
17
+
18
+ it "forms the correct header" do
19
+ correct_header = "Meeting Minutes: December 4"
20
+ expect(@meeting.title).to eq correct_header
21
+ end
22
+
23
+ it "generates the correct template" do
24
+ filepath = File.expand_path('../../data/meetingstemp_filled.md', __FILE__)
25
+ correct_file_array = File.open(filepath).readlines
26
+ expect(@meeting.file_array).to eq correct_file_array
27
+ end
28
+ end
29
+
30
+ RSpec.describe ProjectsGenerator do
31
+ let(:date) { Date.parse("2015-12-04") }
32
+ let(:author) { "Benjamin Lannon" }
33
+ let(:title) { "Update on Foobar" }
34
+
35
+ before(:each) do
36
+ @project = ProjectsGenerator.new(author, title, date)
37
+ end
38
+
39
+ it "has the passed in date" do
40
+ expect(@project.date).to eq date
41
+ end
42
+
43
+ it "creates the name of the file" do
44
+ expect(@project.filename).to eq "2015-12-04-update-on-foobar.md"
45
+ end
46
+
47
+ it "generates the correct template" do
48
+ filepath = File.expand_path('../../data/projectstemp_filled.md', __FILE__)
49
+ correct_file_array = File.open(filepath).readlines
50
+ expect(@project.file_array).to eq correct_file_array
51
+ end
52
+ end
@@ -0,0 +1,11 @@
1
+ require 'cosi-temp'
2
+ RSpec.configure do |config|
3
+
4
+ config.expect_with :rspec do |expectations|
5
+ expectations.include_chain_clauses_in_custom_matcher_descriptions = true
6
+ end
7
+
8
+ config.mock_with :rspec do |mocks|
9
+ mocks.verify_partial_doubles = true
10
+ end
11
+ end
metadata ADDED
@@ -0,0 +1,107 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: cosi-temp
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Benjamin Lannon
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-12-29 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.3'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.3'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ description: A simple CLI tool to create a Project Update post or Meeting Minutes
56
+ entry for the Clarkson Open Source Institute
57
+ email: brlannon118@gmail.com
58
+ executables:
59
+ - cosi-temp
60
+ extensions: []
61
+ extra_rdoc_files: []
62
+ files:
63
+ - ".gitignore"
64
+ - ".rspec"
65
+ - ".travis.yml"
66
+ - Gemfile
67
+ - Gemfile.lock
68
+ - LICENSE
69
+ - README.md
70
+ - Rakefile
71
+ - bin/cosi-temp
72
+ - cosi-temp.gemspec
73
+ - data/meetingstemp.md
74
+ - data/meetingstemp_filled.md
75
+ - data/projectstemp_filled.md
76
+ - lib/cosi-temp.rb
77
+ - lib/cosi-temp/meetings-generator.rb
78
+ - lib/cosi-temp/projects-generator.rb
79
+ - lib/cosi-temp/temp-generator.rb
80
+ - spec/cosi-temp_spec.rb
81
+ - spec/spec_helper.rb
82
+ homepage: https://github.com/lannonbr/cosi-temp
83
+ licenses:
84
+ - MIT
85
+ metadata: {}
86
+ post_install_message:
87
+ rdoc_options: []
88
+ require_paths:
89
+ - lib
90
+ required_ruby_version: !ruby/object:Gem::Requirement
91
+ requirements:
92
+ - - ">="
93
+ - !ruby/object:Gem::Version
94
+ version: '0'
95
+ required_rubygems_version: !ruby/object:Gem::Requirement
96
+ requirements:
97
+ - - ">="
98
+ - !ruby/object:Gem::Version
99
+ version: '0'
100
+ requirements: []
101
+ rubyforge_project:
102
+ rubygems_version: 2.4.8
103
+ signing_key:
104
+ specification_version: 4
105
+ summary: Cosi Temp
106
+ test_files: []
107
+ has_rdoc: