nooma 0.0.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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 3ee5070bbbf111fc2a40779e72b41f0af70c9a87
4
+ data.tar.gz: 172384034ee7ddf2b2d7475992dac9a7b3827e4c
5
+ SHA512:
6
+ metadata.gz: a3a1d2eb0fbd2fad4f5681ff6474162dd4476558cd7b49661f6a7ae2496b568e685672c8861ae0eea220c922232a9984aa4284658e6f1ca48902bc94c31617bc
7
+ data.tar.gz: 00e32cf9a66085e4d55efc573454d3fdf60b875eca6d4e66a3cb3f4c54c59c1ab7fc7ba89e53a8ce75d6cd503f7ec95fe58efb05a4e845fcf88ad87850d507f0
data/LICENSE ADDED
@@ -0,0 +1,18 @@
1
+ Copyright (c) 2016 Nooma Inc.
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
4
+ this software and associated documentation files (the "Software"), to deal in
5
+ the Software without restriction, including without limitation the rights to
6
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
7
+ the Software, and to permit persons to whom the Software is furnished to do so,
8
+ subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in all
11
+ copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
15
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
16
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
17
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
18
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1 @@
1
+ # Nooma CLI
data/bin/nooma ADDED
@@ -0,0 +1,14 @@
1
+ #! /Users/dev1/.rbenv/shims/ruby
2
+
3
+ require_relative '../lib/chapter_helper'
4
+ require_relative '../lib/page_helper'
5
+
6
+ include Nooma::PageHelper
7
+
8
+ if ARGV[0] == 'generate' || ARGV[0] == 'g'
9
+ if ARGV[1] == 'page'
10
+ if ARGV[2]
11
+ create_page(ARGV[2].gsub('_', ' '))
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,7 @@
1
+ module Nooma
2
+ module ApplicationHelper
3
+ def snakecase(str)
4
+ str.downcase.gsub(' ', '_')
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,13 @@
1
+ require_relative 'application_helper'
2
+ require_relative 'file_helper'
3
+
4
+ module Nooma
5
+ module ChapterHelper
6
+ include Nooma::ApplicationHelper
7
+ include Nooma::FileHelper
8
+
9
+ def self.create_chapter(title)
10
+ mkdir(snakecase(title))
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,16 @@
1
+ module Nooma
2
+ module FileHelper
3
+ def mkdir(name)
4
+ Dir.mkdir(name)
5
+ end
6
+
7
+ def cd(name)
8
+ Dir.chdir(name)
9
+ end
10
+
11
+ def mkdir_cd(name)
12
+ mkdir(name)
13
+ cd(name)
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,35 @@
1
+ require 'json'
2
+ require 'securerandom'
3
+ require_relative 'application_helper'
4
+ require_relative 'file_helper'
5
+
6
+ module Nooma
7
+ module PageHelper
8
+ include Nooma::ApplicationHelper
9
+ include Nooma::FileHelper
10
+
11
+ def create_page(title)
12
+ mkdir_cd snakecase(title)
13
+ create_markdown(title)
14
+ create_config(title)
15
+ end
16
+
17
+ def create_markdown(title)
18
+ File.open("#{snakecase(title)}.md", "w") do |f|
19
+ md = "# #{title}"
20
+ f.write(md)
21
+ end
22
+ end
23
+
24
+ def create_config(title)
25
+ File.open("config.json", "w") do |f|
26
+ hash = {
27
+ title: title,
28
+ id: SecureRandom.uuid
29
+ }
30
+
31
+ f.write JSON.pretty_generate(hash)
32
+ end
33
+ end
34
+ end
35
+ end
metadata ADDED
@@ -0,0 +1,65 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: nooma
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Nooma Inc.
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-09-26 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rspec
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ description: "# Nooma CLI\n"
28
+ email: team@nooma.tv
29
+ executables:
30
+ - nooma
31
+ extensions: []
32
+ extra_rdoc_files: []
33
+ files:
34
+ - LICENSE
35
+ - README.md
36
+ - bin/nooma
37
+ - lib/application_helper.rb
38
+ - lib/chapter_helper.rb
39
+ - lib/file_helper.rb
40
+ - lib/page_helper.rb
41
+ homepage: https://www.nooma.tv
42
+ licenses:
43
+ - MIT
44
+ metadata: {}
45
+ post_install_message:
46
+ rdoc_options: []
47
+ require_paths:
48
+ - lib
49
+ required_ruby_version: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - ">="
52
+ - !ruby/object:Gem::Version
53
+ version: '1.9'
54
+ required_rubygems_version: !ruby/object:Gem::Requirement
55
+ requirements:
56
+ - - ">="
57
+ - !ruby/object:Gem::Version
58
+ version: '0'
59
+ requirements: []
60
+ rubyforge_project:
61
+ rubygems_version: 2.5.1
62
+ signing_key:
63
+ specification_version: 4
64
+ summary: Nooma CLI
65
+ test_files: []