devlogs 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/exe/devlogs +1 -1
- data/lib/devlogs/cli.rb +63 -0
- data/lib/devlogs/repository.rb +3 -1
- data/lib/devlogs/version.rb +1 -1
- data/lib/devlogs.rb +1 -54
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b7ac238f0667f25c6b370f32660aa2d089ebbfff0ecec9bffb012f9851188174
|
4
|
+
data.tar.gz: 93aaabcee373c6511a479e6cf21b6803af0cfec922e4416fed2406a966307ced
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5833adbd0231c8fe941364cec3dd6d83878999ed67b8ebf055dda56a12289a0e609ac8cb3e2868db2f4e570e52958622f7f25f997701baf130cf86e730a5daa1
|
7
|
+
data.tar.gz: fe438af20e0f8ec3326bf56ee410f037ef81495e39218586ad70ff8ae7a50a056f2c409db0b4dc02914c47dfb7dca157a9c4082bf0926c6bf739f8f9800f26a3
|
data/Gemfile.lock
CHANGED
data/exe/devlogs
CHANGED
data/lib/devlogs/cli.rb
ADDED
@@ -0,0 +1,63 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "version"
|
4
|
+
require_relative "repository"
|
5
|
+
require "thor"
|
6
|
+
|
7
|
+
module Devlogs
|
8
|
+
#
|
9
|
+
# The CLI devlogs CLI
|
10
|
+
#
|
11
|
+
class CLI < Thor
|
12
|
+
package_name "devlogs"
|
13
|
+
|
14
|
+
# Returns exit with non zero status when an exception occurs
|
15
|
+
def self.exit_on_failure?
|
16
|
+
true
|
17
|
+
end
|
18
|
+
|
19
|
+
#
|
20
|
+
# Returns version of the cli
|
21
|
+
#
|
22
|
+
desc "version", "Prints the current version"
|
23
|
+
def version
|
24
|
+
puts Devlogs::VERSION
|
25
|
+
end
|
26
|
+
|
27
|
+
#
|
28
|
+
# Initializes a +devlogs+ repository with a configuration
|
29
|
+
#
|
30
|
+
desc "init", "Initialize a developer logs for project"
|
31
|
+
method_options force: :boolean, alias: :string
|
32
|
+
def init
|
33
|
+
puts "Creating devlogs repository"
|
34
|
+
|
35
|
+
Repository::Initialize.run(
|
36
|
+
{ force: options.force? },
|
37
|
+
File.join(".", "__devlogs")
|
38
|
+
)
|
39
|
+
|
40
|
+
puts "Created devlogs"
|
41
|
+
end
|
42
|
+
|
43
|
+
#
|
44
|
+
# Creates a devlogs entry in the repository and syncs changes
|
45
|
+
# to the mirrored directory if set
|
46
|
+
#
|
47
|
+
desc "entry", "Create a new devlogs entry" # [4]
|
48
|
+
def entry
|
49
|
+
puts "Creating new entry..."
|
50
|
+
repo.create
|
51
|
+
|
52
|
+
repo.sync
|
53
|
+
end
|
54
|
+
|
55
|
+
private
|
56
|
+
|
57
|
+
# Helper method for repository loading
|
58
|
+
#
|
59
|
+
def repo
|
60
|
+
@repo ||= Repository.load
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
data/lib/devlogs/repository.rb
CHANGED
@@ -167,7 +167,9 @@ class Repository
|
|
167
167
|
|
168
168
|
# Git ignore if specified
|
169
169
|
if results[:gitignore]
|
170
|
-
File.
|
170
|
+
gitignore = File.join(path, ".gitignore")
|
171
|
+
|
172
|
+
File.open(gitignore, "a") do |f|
|
171
173
|
f.puts DEFAULT_DIRECTORY_NAME
|
172
174
|
end
|
173
175
|
end
|
data/lib/devlogs/version.rb
CHANGED
data/lib/devlogs.rb
CHANGED
@@ -1,56 +1,3 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative "devlogs/
|
4
|
-
require_relative "devlogs/repository"
|
5
|
-
|
6
|
-
require "thor"
|
7
|
-
|
8
|
-
module Devlogs
|
9
|
-
#
|
10
|
-
# The CLI devlogs App
|
11
|
-
#
|
12
|
-
class App < Thor
|
13
|
-
package_name "devlogs"
|
14
|
-
|
15
|
-
# Returns exit with non zero status when an exception occurs
|
16
|
-
def self.exit_on_failure?
|
17
|
-
true
|
18
|
-
end
|
19
|
-
|
20
|
-
#
|
21
|
-
# Initializes a +devlogs+ repository with a configuration
|
22
|
-
#
|
23
|
-
desc "init", "Initialize a developer logs for project"
|
24
|
-
method_options force: :boolean, alias: :string
|
25
|
-
def init
|
26
|
-
puts "Creating devlogs repository"
|
27
|
-
|
28
|
-
Repository::Initialize.run(
|
29
|
-
{ force: options.force? },
|
30
|
-
File.join(".", "__devlogs")
|
31
|
-
)
|
32
|
-
|
33
|
-
puts "Created devlogs"
|
34
|
-
end
|
35
|
-
|
36
|
-
#
|
37
|
-
# Creates a devlogs entry in the repository and syncs changes
|
38
|
-
# to the mirrored directory if set
|
39
|
-
#
|
40
|
-
desc "entry", "Create a new devlogs entry" # [4]
|
41
|
-
def entry
|
42
|
-
puts "Creating new entry..."
|
43
|
-
repo.create
|
44
|
-
|
45
|
-
repo.sync
|
46
|
-
end
|
47
|
-
|
48
|
-
private
|
49
|
-
|
50
|
-
# Helper method for repository loading
|
51
|
-
#
|
52
|
-
def repo
|
53
|
-
@repo ||= Repository.load
|
54
|
-
end
|
55
|
-
end
|
56
|
-
end
|
3
|
+
require_relative "devlogs/cli"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: devlogs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- aquaflamingo
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-04-
|
11
|
+
date: 2022-04-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rsync
|
@@ -94,6 +94,7 @@ files:
|
|
94
94
|
- docs/mirroring.png
|
95
95
|
- exe/devlogs
|
96
96
|
- lib/devlogs.rb
|
97
|
+
- lib/devlogs/cli.rb
|
97
98
|
- lib/devlogs/repository.rb
|
98
99
|
- lib/devlogs/version.rb
|
99
100
|
homepage: http://github.com/aquaflamingo/devlogs
|