k_builder-package_json 0.0.6 → 0.0.9
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 +4 -4
- data/README.md +10 -3
- data/STORIES.md +6 -8
- data/k_builder-package_json.gemspec +1 -1
- data/lib/k_builder/package_json/package_builder.rb +18 -19
- data/lib/k_builder/package_json/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 23d2f90c746d39ced107f762903d8857f7d315a9e54cedfa9c33a877838db28a
|
4
|
+
data.tar.gz: b20e9deca13d3a4004848fd2f01e6201387bf3d26c15653bd6600a83a81b5fd8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 57b484f59d3259e9c2c843f0e02258671eef8f075c37a8b55c4f86aa0a259de3e8b04e3a48cb6c115454e031507214feb34c23d987181e91cea255dfd567db64
|
7
|
+
data.tar.gz: 846d63c74636b0018f15cf57974ea20f49c3ea35eaa61f3550688ff7b09f6d0ed4e7efe88f160830e1a727e56a7545057b96534d9c91994397639e7080342a6e
|
data/README.md
CHANGED
@@ -26,16 +26,23 @@ gem install k_builder-package_json
|
|
26
26
|
|
27
27
|
### Main Story
|
28
28
|
|
29
|
-
|
29
|
+
As a Javascript Developer, I want to automatically configure package.json with my defaults, so I can get up and running quickly
|
30
30
|
|
31
31
|
See all [stories](./STORIES.md)
|
32
32
|
|
33
|
-
|
34
33
|
## Usage
|
35
34
|
|
36
35
|
See all [usage examples](./USAGE.md)
|
37
36
|
|
37
|
+
### Basic Example
|
38
|
+
|
39
|
+
#### Basic example
|
38
40
|
|
41
|
+
Description for a basic example to be featured in the main README.MD file
|
42
|
+
|
43
|
+
```ruby
|
44
|
+
class SomeRuby; end
|
45
|
+
```
|
39
46
|
|
40
47
|
## Development
|
41
48
|
|
@@ -45,7 +52,7 @@ Checkout the repo
|
|
45
52
|
git clone klueless-io/k_builder-package_json
|
46
53
|
```
|
47
54
|
|
48
|
-
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests.
|
55
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests.
|
49
56
|
|
50
57
|
You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
51
58
|
|
data/STORIES.md
CHANGED
@@ -8,17 +8,10 @@ As a Javascript Developer, I want to automatically configure package.json with m
|
|
8
8
|
|
9
9
|
### Stories next on list
|
10
10
|
|
11
|
-
As a Developer, I
|
12
|
-
|
13
|
-
- Subtask
|
11
|
+
As a Javascript Developer, I want to automatically configure package.json with my defaults, so I can get up and running quickly
|
14
12
|
|
15
13
|
### Tasks next on list
|
16
14
|
|
17
|
-
Setup RubyGems and RubyDoc
|
18
|
-
|
19
|
-
- Build and deploy gem to [rubygems.org](https://rubygems.org/gems/k_builder-package_json)
|
20
|
-
- Attach documentation to [rubydoc.info](https://rubydoc.info/github/to-do-/k_builder-package_json/master)
|
21
|
-
|
22
15
|
Setup GitHub Action (test and lint)
|
23
16
|
|
24
17
|
- Setup Rspec action
|
@@ -28,6 +21,11 @@ Setup GitHub Action (test and lint)
|
|
28
21
|
|
29
22
|
### Tasks - completed
|
30
23
|
|
24
|
+
Setup RubyGems and RubyDoc
|
25
|
+
|
26
|
+
- Build and deploy gem to [rubygems.org](https://rubygems.org/gems/k_builder-package_json)
|
27
|
+
- Attach documentation to [rubydoc.info](https://rubydoc.info/github/to-do-/k_builder-package_json/master)
|
28
|
+
|
31
29
|
Setup project management, requirement and SCRUM documents
|
32
30
|
|
33
31
|
- Setup readme file
|
@@ -3,12 +3,14 @@
|
|
3
3
|
module KBuilder
|
4
4
|
module PackageJson
|
5
5
|
# Configuration currently comes from KBuilder and stores template folders and target folders if configured
|
6
|
-
class PackageBuilder < KBuilder::
|
7
|
-
SETTER_METHODS = %w[dependency_type].freeze
|
8
|
-
|
6
|
+
class PackageBuilder < KBuilder::BaseBuilder
|
9
7
|
# In memory representation of the package.json file that is being created
|
8
|
+
|
10
9
|
attr_writer :package
|
11
10
|
|
11
|
+
attr_reader :package_file
|
12
|
+
attr_accessor :dependency_type
|
13
|
+
|
12
14
|
def initialize(configuration = nil)
|
13
15
|
super(configuration)
|
14
16
|
|
@@ -16,25 +18,20 @@ module KBuilder
|
|
16
18
|
set_dependency_type(:development)
|
17
19
|
end
|
18
20
|
|
19
|
-
# Return an array of symbols to represent the fluent setter methods in this builder.
|
20
|
-
def builder_setter_methods
|
21
|
-
SETTER_METHODS
|
22
|
-
end
|
23
|
-
|
24
21
|
# ----------------------------------------------------------------------
|
25
22
|
# Fluent interface
|
26
23
|
# ----------------------------------------------------------------------
|
27
24
|
|
28
25
|
# Change context to production, new dependencies will be for production
|
29
26
|
def production
|
30
|
-
set_dependency_type
|
27
|
+
set_dependency_type(:production)
|
31
28
|
|
32
29
|
self
|
33
30
|
end
|
34
31
|
|
35
32
|
# Change context to development, new dependencies will be for development
|
36
33
|
def development
|
37
|
-
set_dependency_type
|
34
|
+
set_dependency_type(:development)
|
38
35
|
|
39
36
|
self
|
40
37
|
end
|
@@ -189,9 +186,11 @@ module KBuilder
|
|
189
186
|
# Dependency type
|
190
187
|
# ----------------------------------------------------------------------
|
191
188
|
|
192
|
-
#
|
193
|
-
def
|
194
|
-
|
189
|
+
# Fluent setter for target folder
|
190
|
+
def set_dependency_type(value)
|
191
|
+
self.dependency_type = value
|
192
|
+
|
193
|
+
self
|
195
194
|
end
|
196
195
|
|
197
196
|
# Target folder
|
@@ -206,13 +205,13 @@ module KBuilder
|
|
206
205
|
|
207
206
|
# Setter for target folder
|
208
207
|
def package_file=(_value)
|
209
|
-
|
208
|
+
@package_file = File.join(target_folder, 'package.json')
|
210
209
|
end
|
211
210
|
|
212
|
-
# Getter for target folder
|
213
|
-
def package_file
|
214
|
-
|
215
|
-
end
|
211
|
+
# # Getter for target folder
|
212
|
+
# def package_file
|
213
|
+
# hash['package_file']
|
214
|
+
# end
|
216
215
|
|
217
216
|
# -----------------------------------
|
218
217
|
# Helpers
|
@@ -259,7 +258,7 @@ module KBuilder
|
|
259
258
|
|
260
259
|
# This is all wrong, but useful for now
|
261
260
|
def context
|
262
|
-
KBuilder.data.to_struct(
|
261
|
+
@context ||= KBuilder.data.to_struct(configuration)
|
263
262
|
end
|
264
263
|
|
265
264
|
def get_group(key)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: k_builder-package_json
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Cruwys
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-03-
|
11
|
+
date: 2021-03-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: k_builder
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.0
|
19
|
+
version: '0.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.0
|
26
|
+
version: '0.0'
|
27
27
|
description: " KBuilder-PackageJson provides various fluent builders and code generators
|
28
28
|
for building package.json file\n"
|
29
29
|
email:
|