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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 71df877e4dad116332b7a4ce20b68a866227d8b68c458227768ca32d72068a0f
4
- data.tar.gz: 2f0879fa61fcbd5523dbcd491b35b986f4ccb58e39a50bee63b20d605a3dd4fe
3
+ metadata.gz: b7ac238f0667f25c6b370f32660aa2d089ebbfff0ecec9bffb012f9851188174
4
+ data.tar.gz: 93aaabcee373c6511a479e6cf21b6803af0cfec922e4416fed2406a966307ced
5
5
  SHA512:
6
- metadata.gz: 1afea8edd55cf989dd67023beacd291d8e116c8b4f55c669c69f46970f39fe64a646169100632b9200060eaa01b85610a23d7f5b5bafa4142030c434847d94d7
7
- data.tar.gz: c496818a7360e41d2a0a9ecf2c2085e8acb755c932b1d5a41e20320e113d978a19c742053aea7d0d14721c085ddecfee45b982462b087676645d9bc27e3e2e23
6
+ metadata.gz: 5833adbd0231c8fe941364cec3dd6d83878999ed67b8ebf055dda56a12289a0e609ac8cb3e2868db2f4e570e52958622f7f25f997701baf130cf86e730a5daa1
7
+ data.tar.gz: fe438af20e0f8ec3326bf56ee410f037ef81495e39218586ad70ff8ae7a50a056f2c409db0b4dc02914c47dfb7dca157a9c4082bf0926c6bf739f8f9800f26a3
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- devlogs (0.1.5)
4
+ devlogs (0.1.6)
5
5
  rsync (~> 1.0, >= 1.0.9)
6
6
  thor (~> 1.2.1)
7
7
  tty-prompt (~> 0.23.1)
data/exe/devlogs CHANGED
@@ -3,4 +3,4 @@
3
3
 
4
4
  require "devlogs"
5
5
 
6
- Devlogs::App.start(ARGV)
6
+ Devlogs::CLI.start(ARGV)
@@ -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
@@ -167,7 +167,9 @@ class Repository
167
167
 
168
168
  # Git ignore if specified
169
169
  if results[:gitignore]
170
- File.open(File.join(path), "a") do |f|
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Devlogs
4
- VERSION = "0.1.5"
4
+ VERSION = "0.1.6"
5
5
  end
data/lib/devlogs.rb CHANGED
@@ -1,56 +1,3 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "devlogs/version"
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.5
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-19 00:00:00.000000000 Z
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