nydp-caxlsx 0.1.0 → 0.1.1

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
- SHA1:
3
- metadata.gz: 93cfbd5ce6aa255f8d6f64918634fd7cada6fac0
4
- data.tar.gz: f82559f4377c8e97e2f672b1e01fd86d21d3a2f5
2
+ SHA256:
3
+ metadata.gz: 19afad8199bae5b8dc15a2bdc829e1f3880f7a32f0e05bf25f86829988a1b089
4
+ data.tar.gz: 02e9143589cb791e98a86cc3be075ec3575af68a14a0f522bf5fb52f5f6e9ca1
5
5
  SHA512:
6
- metadata.gz: 29f0968baca3be2f2c8568e7f8b9d66806022e3ba1d264717c09a9d3f2830d16137e618069079b72d958f083c20e23af82fc2db08ea9c30b582440afa6bea343
7
- data.tar.gz: afa16d9ba9ea24138ec4ed550d507f15aa1e27299d5da0eba186e4eca53c45286bee80fcab10e6b6bce005e1eeba1be8a1abdcaec3b08c53754278f4986a4df5
6
+ metadata.gz: 4125ce412bca399f31440f0f724c7e981a3fb5544b9b1f6ebba32b852002336a10b9d002d9cc978c63b81464995b1510ef53fbcce82f42813665c6769336a073
7
+ data.tar.gz: 5ead9c0b7e685446246e3af8bac1fa4d20e6752039d2ed1627be6e6e3cfa423e49aed07ad0de054a2032274a641e4a2a2d5d334e925350a66e621aa6ec102a0a
data/.gitignore CHANGED
@@ -8,5 +8,6 @@
8
8
  /tmp/
9
9
  test-result.xlsx
10
10
 
11
- # rspec failure tracking
12
11
  .rspec_status
12
+ .#*
13
+ *.gem
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Nydp::Caxlsx
2
2
 
3
- This gem provides a nydp wrapper for the @caxlsx@ gem, allowing you finally generate excel (or libreoffice) spreadsheets from lisp!! The future has arrived!
3
+ This gem provides a nydp wrapper for the [`caxlsx`](https://github.com/caxlsx/caxlsx) gem, allowing you finally generate excel (or libreoffice) spreadsheets from lisp!! The future has arrived!
4
4
 
5
5
 
6
6
  ## Installation
@@ -24,7 +24,7 @@ Or install it yourself as:
24
24
  ```lisp
25
25
  (xls
26
26
  (sheet "big sheet"
27
- (let s0 (style {})
27
+ (let s0 (style { b t bg_color "FFCCFFDD" })
28
28
  (each item items
29
29
  (row (list item.created_at
30
30
  item.name
@@ -32,11 +32,9 @@ Or install it yourself as:
32
32
  item.lorentz_factor
33
33
  item.wave_function
34
34
  item.polarity)
35
- { style (list s0 s1 s2 s3 s4 s5) })))))
35
+ { style s0 })))))
36
36
  ```
37
37
 
38
- TODO: Write usage instructions here
39
-
40
38
  ## Development
41
39
 
42
40
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
@@ -45,7 +43,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
45
43
 
46
44
  ## Contributing
47
45
 
48
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/nydp-caxlsx. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
46
+ Bug reports and pull requests are welcome on GitHub at https://github.com/conanite/nydp-caxlsx. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
49
47
 
50
48
  ## License
51
49
 
@@ -53,4 +51,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
53
51
 
54
52
  ## Code of Conduct
55
53
 
56
- Everyone interacting in the Nydp::Caxlsx project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/nydp-caxlsx/blob/master/CODE_OF_CONDUCT.md).
54
+ Everyone interacting in the Nydp::Caxlsx project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/conanite/nydp-caxlsx/blob/master/CODE_OF_CONDUCT.md).
@@ -3,16 +3,22 @@
3
3
  (assign xls-dsl {})
4
4
 
5
5
  (def xls-dsl.sheet (name . body)
6
- `(let xls-worksheet (xls/worksheet/new xls-package ,name)
6
+ `(with (xls-worksheet (xls/worksheet/new xls-package ,name)
7
+ xls-row-number 1)
7
8
  ,@body))
8
9
 
9
10
  (def xls-dsl.style (rules)
10
11
  `(xls/style/new xls-package ,rules))
11
12
 
12
13
  (def xls-dsl.row (items options)
13
- (if options
14
- `(xls/row/new xls-worksheet ,items ,options)
15
- `(xls/row/new xls-worksheet ,items)))
14
+ `(do
15
+ ,(if options
16
+ `(xls/row/new xls-worksheet ,items ,options)
17
+ `(xls/row/new xls-worksheet ,items))
18
+ (++ xls-row-number)))
19
+
20
+ (def xls-dsl.column-widths (widths)
21
+ `(xls/worksheet/column-widths xls-worksheet widths))
16
22
 
17
23
  (mac xls workbooks
18
24
  `(returnlet xls-package (xls/package/new)
data/lib/nydp/caxlsx.rb CHANGED
@@ -27,10 +27,11 @@ module Nydp
27
27
  end
28
28
 
29
29
  def setup ns
30
- Nydp::Symbol.mk("xls/package/new" , ns).assign(Nydp::Caxlsx::Builtin::NewPackage.instance)
31
- Nydp::Symbol.mk("xls/worksheet/new" , ns).assign(Nydp::Caxlsx::Builtin::NewWorksheet.instance)
32
- Nydp::Symbol.mk("xls/row/new" , ns).assign(Nydp::Caxlsx::Builtin::NewRow.instance)
33
- Nydp::Symbol.mk("xls/style/new" , ns).assign(Nydp::Caxlsx::Builtin::NewStyle.instance)
30
+ Nydp::Symbol.mk("xls/package/new" , ns).assign(Nydp::Caxlsx::Builtin::NewPackage.instance)
31
+ Nydp::Symbol.mk("xls/worksheet/new" , ns).assign(Nydp::Caxlsx::Builtin::NewWorksheet.instance)
32
+ Nydp::Symbol.mk("xls/worksheet/column-widths", ns).assign(Nydp::Caxlsx::Builtin::SetColumnWidths.instance)
33
+ Nydp::Symbol.mk("xls/row/new" , ns).assign(Nydp::Caxlsx::Builtin::NewRow.instance)
34
+ Nydp::Symbol.mk("xls/style/new" , ns).assign(Nydp::Caxlsx::Builtin::NewStyle.instance)
34
35
  end
35
36
  end
36
37
 
@@ -60,6 +61,13 @@ module Nydp
60
61
  end
61
62
  end
62
63
 
64
+ class SetColumnWidths
65
+ include Nydp::Builtin::Base, Singleton
66
+ def builtin_invoke_3 vm, sheet, values
67
+ vm.push_arg sheet.column_widths(n2r(values))
68
+ end
69
+ end
70
+
63
71
  class NewStyle
64
72
  include Nydp::Builtin::Base, Singleton
65
73
  def builtin_invoke_3 vm, package, rules
@@ -1,5 +1,5 @@
1
1
  module Nydp
2
2
  module Caxlsx
3
- VERSION = "0.1.0"
3
+ VERSION = "0.1.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nydp-caxlsx
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - conanite
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-03-25 00:00:00.000000000 Z
11
+ date: 2021-06-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nydp
@@ -122,8 +122,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
122
122
  - !ruby/object:Gem::Version
123
123
  version: '0'
124
124
  requirements: []
125
- rubyforge_project:
126
- rubygems_version: 2.5.2.3
125
+ rubygems_version: 3.0.3
127
126
  signing_key:
128
127
  specification_version: 4
129
128
  summary: nydp wrapper for caxlsx gem