keyboard_reactor 0.0.3 → 0.0.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 62e9a2af4cd2ff17f01715eb17a19edcea9633a2
4
- data.tar.gz: cf9acbce997542c2214641568c15308bd1170f10
3
+ metadata.gz: 1c56aa60987558a2554ede6c15b455ac7b86938d
4
+ data.tar.gz: ff59517928b78ebd6d6581d43fa41a97846a9433
5
5
  SHA512:
6
- metadata.gz: 94ac7abbeed0e499508e568546b0e3f5d4509a89f4065928f9b30f63e6c5d293ba5c68a7af7b63d82202322b8272dde1483986c0d1530d5faf84d905adea8644
7
- data.tar.gz: bcacded08d754ebc1ae1c87440c0826b58d50835a7d07856e3253d8f5af0a40d0f2e766844d5e554848a727025d55eb690dc9492d4dba8e7b3eb1f3db81451d7
6
+ metadata.gz: f993251271d1657b2f563c3e8aa268479c4391678bff8fe432badc91fbe467032d1e14f47312fb4647ede694994aaf8f87399dbc02918aed1fe9ffbd9570a4cc
7
+ data.tar.gz: 22cce8db810228df008752dffe6597cf38f61de2717e3e8cc77cf7a0d5d4589a24a6dd14b3143a2aad7f796e65edc7f798b21d2a87cb9593a6ca7fd66d876911
data/README.md CHANGED
@@ -10,12 +10,15 @@ Reactor uses the awesome [qmk_firmware](http://github.com/jackhumbert/qmk_firmwa
10
10
  ## General process
11
11
 
12
12
  - Take JSON input
13
- - Generate a .c template file base on the JSON and the liquid template named for the type value in in the JSON
14
- - Return the .hex file created from running make with that file
13
+ - Generate a .c template file based on the JSON and the liquid template. Name it something unique
14
+ - Create a hex file by compiling that c file. Name it something unique too
15
+ - Read .hex file and return it
15
16
 
16
17
  # Local development
17
18
 
18
- You can run the tests with `be guard` - which will watch for changes in ruby files and run whenever they do
19
+ You can run the tests with `be guard` - which will watch for changes in ruby files and run whenever they do.
20
+
21
+ Testing is done in ruby 2.2.2
19
22
 
20
23
  ## Updating the firmware
21
24
 
@@ -49,7 +52,9 @@ To update the subtree from the qmk_firmware repository, pull the updates from qm
49
52
 
50
53
  #### Linux
51
54
 
52
- TBD
55
+ Using the instructions from [the teensy loader build environment](https://www.pjrc.com/teensy/gcc.html):
56
+
57
+ sudo apt-get install gcc-avr binutils-avr avr-libc
53
58
 
54
59
  #### Mac OSX
55
60
 
@@ -69,11 +74,3 @@ Then run `make` for the default keymap, or
69
74
 
70
75
  for your own keymap. This requires a files keymap_yourown.c in the subfolder keymaps.
71
76
  You should end up with a `ergodox_ez.hex` file, which you can use with the [Teensy loader](http://www.pjrc.com/teensy/loader_cli.html) or [Teensy GUI](https://www.pjrc.com/teensy/loader.html)
72
-
73
- #### Windows
74
-
75
- TBD
76
-
77
- ## License
78
-
79
- MIT, see LICENSE
@@ -5,19 +5,19 @@ module KeyboardReactor
5
5
  @id = "#{(Time.now.to_f * 100).round}reactor"
6
6
  end
7
7
 
8
- attr_reader :tmp_dir, :keyboard_hash, :find_type, :id
9
- attr_writer :keyboard_type
8
+ attr_reader :tmp_dir, :keyboard_hash, :find_kind, :id
9
+ attr_writer :keyboard_kind
10
10
 
11
11
  def self.relative_path(path)
12
12
  File.expand_path(path, BASE_DIR)
13
13
  end
14
14
 
15
- def self.known_types
15
+ def self.known_kinds
16
16
  COLUMNS.keys
17
17
  end
18
18
 
19
19
  def firmware_path
20
- self.class.relative_path("firmware/keyboard/#{keyboard_type}")
20
+ self.class.relative_path("firmware/keyboard/#{keyboard_kind}")
21
21
  end
22
22
 
23
23
  def c_file_path
@@ -28,21 +28,21 @@ module KeyboardReactor
28
28
  @hex_file_path ||= self.class.relative_path("#{firmware_path}/#{@id}.hex")
29
29
  end
30
30
 
31
- def keyboard_type
32
- @keyboard_type ||= @keyboard_hash['type']
33
- return @keyboard_type.to_s if self.class.known_types.include?(@keyboard_type)
34
- fail "Unknown keyboard type '#{@keyboard_type}', not one of #{self.class.known_types}"
31
+ def keyboard_kind
32
+ @keyboard_kind ||= @keyboard_hash['kind']
33
+ return @keyboard_kind.to_s if self.class.known_kinds.include?(@keyboard_kind)
34
+ fail "Unknown keyboard kind '#{@keyboard_kind}', not one of #{self.class.known_kinds}"
35
35
  end
36
36
 
37
37
  def layout_template
38
- path = "./keyboard_reactor/templates/#{keyboard_type}.liquid"
38
+ path = "./keyboard_reactor/templates/#{keyboard_kind}.liquid"
39
39
  File.read(self.class.relative_path(path))
40
40
  end
41
41
 
42
42
  def c_file
43
43
  Liquid::Template.parse(layout_template)
44
44
  .render(
45
- 'columns' => COLUMNS[keyboard_type],
45
+ 'columns' => COLUMNS[keyboard_kind],
46
46
  'layout' => @keyboard_hash
47
47
  )
48
48
  end
@@ -52,8 +52,6 @@ module KeyboardReactor
52
52
  end
53
53
 
54
54
  def hex
55
- return default_hex
56
-
57
55
  write_c_file
58
56
  # Override the default target with our ID so that we create unique files
59
57
  `cd #{firmware_path.to_s} && make clean && TARGET=#{id} make -e KEYMAP="#{id}"`
@@ -70,7 +68,7 @@ module KeyboardReactor
70
68
  end
71
69
 
72
70
  def default_hex
73
- @hex_file_path = "#{firmware_path}/#{keyboard_type}.hex"
71
+ @hex_file_path = "#{firmware_path}/#{keyboard_kind}.hex"
74
72
  `cd #{firmware_path.to_s} && make clean && make KEYMAP="default"`
75
73
  read_hex_file
76
74
  end
@@ -1,3 +1,3 @@
1
1
  module KeyboardReactor
2
- VERSION = '0.0.3'
2
+ VERSION = '0.0.5'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: keyboard_reactor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - sethherr
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-12-31 00:00:00.000000000 Z
12
+ date: 2016-01-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: multi_json