invoice_printer 2.0.0.alpha1 → 2.0.0.beta1

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: cdf5ab1be5ba608592e459feb3295450b61fb43d063adf9e250281bad74fa87e
4
- data.tar.gz: ffbe76f56621e22d5e0020ba0a285305b4ce018f5923d7240e543140fb8b9acd
3
+ metadata.gz: 1a929bb5d414cc64bf5f30a97baa8b7b39e9a3bb12eb03efe96eab827bc417b4
4
+ data.tar.gz: a1ab11498fed952e4d008aa93d00e2ab2be4b73a65cb38d03e04aa226d027e5e
5
5
  SHA512:
6
- metadata.gz: 9d5f1023dd14f26e190b579edf7a4def0f86530574d64024a4ebd49d82735efcd4294a0913e09c95a38ed44e8a12fe46ac56326e8e1d8db565d3a9df242a9441
7
- data.tar.gz: f768d976020dc7397241344cecf5daa164e24e51f71815105cf37d781b8d9e278a6f98af3445cbb97deb8df3d46dbc082be5999e666016735ff411ae975d1059
6
+ metadata.gz: e93b4d97f28e264dd6385776a49852614ad454fdbe80d00e2d66d3dd98c7614a9c74953a02d30744eb5a148ce250e6418c20a7107a32d0400062e5311f79ac49
7
+ data.tar.gz: 2c1907bb3b0e0fc111139f9fdf808dd869c0dc41d359cee43cd1178919670c312be30361c362e74a0a76f8771b6d925a1edaff358348bba68676e3e821ec316b
@@ -0,0 +1,34 @@
1
+ # To build the Docker image:
2
+ #
3
+ # $ sudo systemctl start docker
4
+ # $ sudo docker build -t printer .
5
+ #
6
+ # To run it:
7
+ #
8
+ # $ sudo docker run -d -p 9393:9393 -t printer
9
+ #
10
+ # To push to repository:
11
+ #
12
+ # $ sudo docker login
13
+ # $ sudo docker tag printer docker.io/strzibnyj/invoice_printer_server:latest
14
+ # $ sudo docker push strzibnyj/invoice_printer_server:latest
15
+ FROM alpine:3.10
16
+ MAINTAINER Josef Strzibny <strzibny@strzibny.name>
17
+
18
+ ENV GEM_HOME="/usr/local/bundle"
19
+ ENV PATH $GEM_HOME/bin:$GEM_HOME/gems/bin:$PATH
20
+
21
+ # Update system
22
+ RUN apk update && apk upgrade
23
+
24
+ # Install Ruby and build dependencies
25
+ RUN apk add build-base bash ruby ruby-etc ruby-dev
26
+
27
+ # Install gem from RubyGems.org
28
+ RUN gem install invoice_printer_server --version 2.0.0.beta1 --no-document
29
+
30
+ # Clean APK cache
31
+ RUN rm -rf /var/cache/apk/*
32
+
33
+ # Run the server on port 80
34
+ ENTRYPOINT ["/usr/local/bundle/bin/invoice_printer_server", "-p9393"]
@@ -5,7 +5,7 @@ require 'optparse'
5
5
  require 'invoice_printer'
6
6
 
7
7
  def show_version
8
- puts "InvoicePrinter Server v#{InvoicePrinter::VERSION}"
8
+ puts "InvoicePrinter v#{InvoicePrinter::VERSION}"
9
9
 
10
10
  exit 0
11
11
  end
@@ -4,10 +4,13 @@
4
4
 
5
5
  This requires Ruby to be installed.
6
6
 
7
- Then install the gem as:
7
+ Install the library and command line as:
8
8
 
9
9
  $ gem install invoice_printer
10
10
 
11
+ Or the server version as:
12
+
13
+ $ gem install invoice_printer_server
11
14
 
12
15
  ### With Bundler
13
16
 
@@ -17,6 +20,24 @@ Add this line to your application's Gemfile:
17
20
  gem 'invoice_printer'
18
21
  ```
19
22
 
23
+ For the server:
24
+
25
+ ```ruby
26
+ gem 'invoice_printer_server'
27
+ ```
28
+
20
29
  And then execute:
21
30
 
22
- $ bundle
31
+ $ bundle
32
+
33
+ ## Using Docker
34
+
35
+ InvoicePrinter Server is available as a Docker image.
36
+
37
+ This requires Docker to be installed and running.
38
+
39
+ To get it:
40
+
41
+ ```bash
42
+ $ sudo docker pull strzibnyj/invoice_printer_server
43
+ ```
@@ -1,24 +1,34 @@
1
1
  # InvoicePrinter Server
2
2
 
3
- InvoicePrinter contains a built in server that can be run from a command line with `invoice_printer_server`.
3
+ InvoicePrinter comes with a server that can be run from a command line with `invoice_printer_server`. Since 2.x releases this server is packaged separately in `invoice_printer_server` gem.
4
4
 
5
5
  Apart from this you can also manually mount the server inside of your Rack application.
6
6
 
7
7
  ## Running the server
8
8
 
9
- ### From command line
9
+ ### From a command line
10
10
 
11
- Once installed, InvoicePrinter provides `invoice_printer_server` executable that starts the Puma server:
11
+ Once installed, InvoicePrinter Server provides `invoice_printer_server` executable that starts the Puma server:
12
12
 
13
13
  ```bash
14
- invoice_printer_server -h 0.0.0.0 -p 5000
14
+ $ invoice_printer_server -h 0.0.0.0 -p 5000
15
15
  ```
16
16
 
17
17
  `-h` defines a host and `-p` defines a port. For help you can run `--help`.
18
18
 
19
19
  By default server binds to `0.0.0.0:9393`.
20
20
 
21
- ### As mountable Rack app
21
+ #### As a Docker image
22
+
23
+ Get the public image and run it:
24
+
25
+ ```bash
26
+ $ sudo docker pull strzibnyj/invoice_printer_server:latest
27
+ $ sudo docker run -d -p 9393:9393 -t docker.io/strzibnyj/invoice_printer_server
28
+ ```
29
+ The server will then be available on `0.0.0.0:9393`.
30
+
31
+ ### As a mountable Rack app
22
32
 
23
33
  If you want you can always run the server from your custom program or mount it directly from a Rack app.
24
34
 
@@ -29,6 +29,8 @@ Gem::Specification.new do |spec|
29
29
  spec.require_paths = ['lib']
30
30
  spec.bindir = 'bin'
31
31
 
32
+ spec.required_ruby_version = '>= 2.4'
33
+
32
34
  spec.add_dependency 'json', '~> 2.1'
33
35
  spec.add_dependency 'prawn', '~> 2.1.0'
34
36
  spec.add_dependency 'prawn-layout', '~> 0.8.4'
@@ -25,6 +25,8 @@ Gem::Specification.new do |spec|
25
25
  spec.require_paths = ['lib']
26
26
  spec.bindir = 'bin'
27
27
 
28
+ spec.required_ruby_version = '>= 2.4'
29
+
28
30
  spec.add_dependency 'invoice_printer', InvoicePrinter::VERSION
29
31
  spec.add_dependency 'json', '~> 2.1'
30
32
  spec.add_dependency 'roda', '~> 3.5'
@@ -1,3 +1,3 @@
1
1
  module InvoicePrinter
2
- VERSION = '2.0.0.alpha1'
2
+ VERSION = '2.0.0.beta1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: invoice_printer
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.alpha1
4
+ version: 2.0.0.beta1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josef Strzibny
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-07-04 00:00:00.000000000 Z
11
+ date: 2019-07-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -89,6 +89,7 @@ extensions: []
89
89
  extra_rdoc_files: []
90
90
  files:
91
91
  - ".gitignore"
92
+ - Dockerfile
92
93
  - Gemfile
93
94
  - Gemfile.lock
94
95
  - LICENSE.txt
@@ -148,7 +149,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
148
149
  requirements:
149
150
  - - ">="
150
151
  - !ruby/object:Gem::Version
151
- version: '0'
152
+ version: '2.4'
152
153
  required_rubygems_version: !ruby/object:Gem::Requirement
153
154
  requirements:
154
155
  - - ">"