boards 0.1.1.1 → 0.1.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7c1e3052980eadc07b0c57f10980437497ca7d7fb20fd8ee1c4712c64a02c64b
4
- data.tar.gz: 7de3d12ef66241952c7bf5a2979a2d353e53b926b330b8ab52afd6f37f7f4ae2
3
+ metadata.gz: 0eafce8f2d023b17b53aab9438a34da1b3447d055d041798b0f5e734c50e905d
4
+ data.tar.gz: 04702eaa47247fa4493f90f5cefccdf8a7f25ac5c6591100b92881447a91c3e5
5
5
  SHA512:
6
- metadata.gz: 47d4e340c7d270137b389db8d96c143c2ea17b3ca27157f2151f0cedd8f10fe1b3ac06045e4085a430d2b1dc1e6651e550851447745218ad5b23123bf993964e
7
- data.tar.gz: ac5115753a7e39b6bdba0cb0e3a742dec8b6f248c05a213c1bcec46728658f78f8bf02726c0a51b14f60f7a6517614d702150f58114a330474db24d58239ce7b
6
+ metadata.gz: ecfafa660bec1b88f04ecd79f52f1ecb0f9a822bf56fcfb6a41bc51923233b04b1f5f741e59759fbb009de153cf1eeb34aca743607f6410c745660cc59a4f697
7
+ data.tar.gz: fb86e79b447ff0dae8b2292172427834fed6eda225e3129ca4b2f2b09af5d9ddbe70280191aa8d90159a66282b02046fecf8633c57b51230a1735a32599057d3
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- boards (0.1.1.1)
4
+ boards (0.1.1.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  The goal is to create a gem that facilitates the remote programming of Raspberry Pis. In particular - to develop a user friendly rubyesque DSL to describe the setup of a Raspberry Pi board.
4
4
 
5
+ [![Gem Version](https://badge.fury.io/rb/boards.svg)](https://badge.fury.io/rb/boards)
6
+
5
7
  ## Installation
6
8
 
7
9
  Add this line to your application's Gemfile:
@@ -18,6 +20,11 @@ Or install it yourself as:
18
20
 
19
21
  $ gem install boards
20
22
 
23
+ Bundle edge Boards instead? Uncomment this line in your application's Gemfile:
24
+
25
+ ```ruby
26
+ gem 'boards', github: 'osullii/boards'
27
+ ```
21
28
  ## Usage
22
29
 
23
30
  To create a new Boards project on your development machine.
data/exe/boards CHANGED
@@ -1,5 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  require "boards/cli"
4
+ require "boards/new_project"
4
5
 
5
6
  Boards::Cli.start(ARGV)
data/lib/boards/cli.rb CHANGED
@@ -1,25 +1,8 @@
1
1
  require "thor"
2
+ require "boards/new_project"
2
3
  module Boards
3
4
  class Cli < Thor
4
5
  include Thor::Actions
5
-
6
- desc 'new NAME', 'generates a new directory named NAME for a new boards project, including stub files and boilerplate code.'
7
- def new(name)
8
- puts "Ahoy! You would like to generate a new project called #{name.capitalize}!"
9
- dir_name = name.downcase
10
- unless Dir.exists?(dir_name)
11
- Dir.mkdir(dir_name)
12
- say "create \t#{dir_name}/", :green
13
- else
14
- say "dir \t#{dir_name}/ already exists", :blue
15
- end
16
- file_name = 'setup.rb'
17
- unless File.exists?("#{dir_name}/#{file_name}")
18
- File.open("#{dir_name}/#{file_name}", "w") {|f| f.write "# I am a setup file."}
19
- say "create \t#{dir_name}/#{file_name}", :green
20
- else
21
- say "file \t#{dir_name}/#{file_name} already exists", :blue
22
- end
23
- end
6
+ register(Boards::NewProject, 'new', 'new', 'new boards project named NAME')
24
7
  end
25
8
  end
@@ -0,0 +1,47 @@
1
+ require "thor"
2
+ require "boards/new_project"
3
+ module Boards
4
+ class NewProject < Thor::Group
5
+ include Thor::Actions
6
+ argument :name, type: :string, desc: 'creates a project named NAME'
7
+
8
+ desc "creates a project directory named NAME. Creates stub files and boilerplate code."
9
+ def create_directory
10
+ dir_name = name.downcase
11
+ unless Dir.exists?(dir_name)
12
+ Dir.mkdir(dir_name)
13
+ say "create \t#{dir_name}/", :green
14
+ else
15
+ say "dir \t#{dir_name}/ already exists", :blue
16
+ end
17
+ end
18
+
19
+ def create_setup_rb
20
+ dir_name = name.downcase
21
+ file_name = 'setup.rb'
22
+ unless File.exists?("#{dir_name}/#{file_name}")
23
+ File.open("#{dir_name}/#{file_name}", "w") {|f| f.write "# I am a setup file."}
24
+ say "create \t#{dir_name}/#{file_name}", :green
25
+ else
26
+ say "file \t#{dir_name}/#{file_name} already exists", :blue
27
+ end
28
+ end
29
+
30
+ def create_gemfile
31
+ dir_name = name.downcase
32
+ file_name = 'Gemfile'
33
+ unless File.exists?("#{dir_name}/#{file_name}")
34
+ File.open("#{dir_name}/#{file_name}", "w") do |f|
35
+ f.write "source 'https://rubygems.org'\n"
36
+ f.write 'git_source(:github) { |repo| "https://github.com/#{repo}.git" }'
37
+ f.write "\n\n"
38
+ f.write "# Bundle edge Boards instead: gem 'boards', github: 'osullii/boards'\n"
39
+ f.write "gem 'boards', #{Boards::VERSION}"
40
+ end
41
+ say "create \t#{dir_name}/#{file_name}", :green
42
+ else
43
+ say "file \t#{dir_name}/#{file_name} already exists", :blue
44
+ end
45
+ end
46
+ end
47
+ end
@@ -1,3 +1,3 @@
1
1
  module Boards
2
- VERSION = "0.1.1.1"
2
+ VERSION = "0.1.1.2"
3
3
  end
data/lib/boards.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  require "boards/version"
2
2
  require "boards/cli"
3
+ require "boards/new_project"
3
4
 
4
5
  module Boards
5
6
  class Error < StandardError; end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: boards
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1.1
4
+ version: 0.1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Irial O'Sullivan
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-06-29 00:00:00.000000000 Z
11
+ date: 2019-06-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -91,6 +91,7 @@ files:
91
91
  - exe/boards
92
92
  - lib/boards.rb
93
93
  - lib/boards/cli.rb
94
+ - lib/boards/new_project.rb
94
95
  - lib/boards/version.rb
95
96
  homepage: https://github.com/osullii/colony
96
97
  licenses: