acv2lrtemplate 0.1.0 → 0.2.0

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: 6d91651b23a20caa9698c0c5b20b0ce018a2372b
4
- data.tar.gz: e83f1ae7984611c854c7097619d290ad2b336fe1
3
+ metadata.gz: 40a4028b00d5ab5fb9c3d806bc24a7f84ec657da
4
+ data.tar.gz: bfd2720ec152418a77e33f567aee440bf6008a1d
5
5
  SHA512:
6
- metadata.gz: 5879de31c8fe979e2a05bb1293721cfcb1d54b3c5be1b8f918f0d5f4322aea99a3583166e96053fb65e1052f9cd111230e916362ed0635a1fa610885c68281f9
7
- data.tar.gz: c7906c6647808b67f13eca13a0532935509d651a5bb7f5211923631f42f3ec2f53f3e6843cc51d18953254a58f8d1228c7f7d774503bf90a72b82b55f900d5c7
6
+ metadata.gz: 96765ab45b8807ca64f2369ef54fa2229cd0d7928a7236805a58eef4b3793a6948c6f1e643bb620c5dacab40d78fed49fd8b6e77461e6bb525bac199c1622a29
7
+ data.tar.gz: 94cb44b9ca57fe187d098ab5fa61af979e9d2af7be11f2fd49aba3154d9e3bbdc5729f3e59e484e9e6af4b13e2136a81f4f19fe17d3f5c29cef5b85fc63d6cd3
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
- [![Gem Version](https://badge.fury.io/rb/acv2lightroom.svg)](https://badge.fury.io/rb/permitted_attributes)
2
- [![Build Status](https://travis-ci.org/laurentzziu/acv2lightroom.svg?branch=master)](https://travis-ci.org/laurentzziu/acv2lightroom)
1
+ [![Gem Version](https://badge.fury.io/rb/acv2lrtemplate.svg)](https://badge.fury.io/rb/acv2lrtemplate)
2
+ [![Build Status](https://travis-ci.org/laurentzziu/acv2lrtemplate.svg?branch=master)](https://travis-ci.org/laurentzziu/acv2lrtemplate)
3
3
 
4
- # ACV2Lightroom
4
+ # ACV2LRTemplate
5
5
 
6
6
  Easily convert `.acv` (Photoshop Curves) to `.lrtemplate` (Adobe Lightroom Preset) files.
7
7
 
@@ -14,7 +14,7 @@ Converts Adobe Photoshop Curves (`.acv` files) to Adobe Lightroom Presets (`.lrt
14
14
  Add this line to your application's Gemfile:
15
15
 
16
16
  ```ruby
17
- gem 'acv2lightroom'
17
+ gem 'acv2lrtemplate'
18
18
  ```
19
19
 
20
20
  And then execute:
@@ -23,10 +23,37 @@ And then execute:
23
23
 
24
24
  Or install it yourself as:
25
25
 
26
- $ gem install acv2lightroom
26
+ $ gem install acv2lrtemplate
27
27
 
28
28
  ## Usage
29
29
 
30
+ #### From console (CLI)
31
+
32
+ ```bash
33
+ # convert .acv file to .lrtemplate
34
+ acv2lrtemplate convert your_curves_file.acv
35
+
36
+ # provide optional name for the .lrtemplate file name
37
+ acv2lrtemplate convert your_curves_file.acv --name Amazing
38
+
39
+ # use the help command for more information
40
+ acv2lrtemplate help
41
+ # or
42
+ acv2lrtemplate help convert
43
+ ```
44
+
45
+ #### In a Ruby script
46
+
47
+ ```ruby
48
+ require 'acv2lrtemplate'
49
+
50
+ # This will create a .lrtemplate file with the name specified in the second parameter (optional).
51
+ # By default, the input file name is used to generate the .lrtemplate file name
52
+
53
+ file_path = "path/to/your/curves/file.acv"
54
+ Acv2lrtemplate.convert!(file_path, "New File name")
55
+ ```
56
+
30
57
  ## Development
31
58
 
32
59
  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.
@@ -35,7 +62,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
35
62
 
36
63
  ## Contributing
37
64
 
38
- Bug reports and pull requests are welcome on GitHub at [https://github.com/laurentzziu/acv2lightroom](https://github.com/laurentzziu/acv2lightroom). 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.
65
+ Bug reports and pull requests are welcome on GitHub at [https://github.com/laurentzziu/acv2lrtemplate](https://github.com/laurentzziu/acv2lrtemplate). 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.
39
66
 
40
67
  ## License
41
68
 
@@ -43,4 +70,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
43
70
 
44
71
  ## Code of Conduct
45
72
 
46
- Everyone interacting in the PermittedAttributes project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/laurentzziu/acv2lightroom/blob/master/CODE_OF_CONDUCT.md).
73
+ Everyone interacting in the PermittedAttributes project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/laurentzziu/acv2lrtemplate/blob/master/CODE_OF_CONDUCT.md).
@@ -4,7 +4,7 @@
4
4
  require "core_ext/#{file}"
5
5
  end
6
6
 
7
- %w(identity parser validator errors json2lrtemplate exporter).each do |file|
7
+ %w(identity parser validator errors json2lrtemplate exporter cli).each do |file|
8
8
  require "acv2lrtemplate/#{file}"
9
9
  end
10
10
 
@@ -0,0 +1,36 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'thor'
4
+ require 'paint'
5
+
6
+ module Acv2lrtemplate
7
+ class CLI < Thor
8
+ method_option :name, type: :string
9
+
10
+ desc "convert [file_path]", "Convert .acv file to .lrtemplate"
11
+ def convert(file_path)
12
+ begin
13
+ file_name = Acv2lrtemplate.convert!(file_path, options[:name])
14
+ print_success(file_name)
15
+ rescue => e
16
+ print_error(e.message)
17
+ end
18
+ rescue
19
+ end
20
+
21
+ def self.exit_on_failure?
22
+ true
23
+ end
24
+
25
+ no_commands do
26
+ def print_success(file_name)
27
+ puts "#{Paint['Success!', :green]} .lrtemplate file created."
28
+ puts "File available in #{file_name}."
29
+ end
30
+
31
+ def print_error(message)
32
+ puts "#{Paint['Error:', :red]} #{message}"
33
+ end
34
+ end
35
+ end
36
+ end
@@ -3,12 +3,15 @@
3
3
  module Acv2lrtemplate
4
4
  module Errors
5
5
  class Base < StandardError
6
+ attr_reader :message
7
+
6
8
  def self.default_message
7
9
  "There was an error."
8
10
  end
9
11
 
10
12
  def initialize(message = nil)
11
- super(message || self.class.default_message)
13
+ @message = message || self.class.default_message
14
+ super(@message)
12
15
  end
13
16
  end
14
17
  end
@@ -3,12 +3,9 @@
3
3
  require 'securerandom'
4
4
  require 'json'
5
5
 
6
- COPYRIGHT = "This file was generated automatically by the Acv2lrtemplate Ruby gem." \
6
+ COPYRIGHT = "This file was generated automatically by the ACV2LRTemplate Ruby gem. (https://github.com/laurentzziu/acv2lrtemplate) " \
7
7
  "Copyright at Florinel Gorgan. https://floringorgan.com"
8
8
 
9
- # parsed = Acv2lrtemplate::Parser.new(File.join(Acv2lrtemplate.spec, 'support', 'files', 's_line.acv'))
10
- # Acv2lrtemplate::Exporter.new(parsed.curves, parsed.acv_file, "S Line").export!
11
-
12
9
  module Acv2lrtemplate
13
10
  class Exporter
14
11
  TITLES = %i(ToneCurvePV2012 ToneCurvePV2012Blue
@@ -8,11 +8,11 @@ module Acv2lrtemplate
8
8
  end
9
9
 
10
10
  def self.label
11
- "Acv2lrtemplate"
11
+ "ACV2LRTemplate"
12
12
  end
13
13
 
14
14
  def self.version
15
- "0.1.0"
15
+ "0.2.0"
16
16
  end
17
17
 
18
18
  def self.version_label
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: acv2lrtemplate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florinel Gorgan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-05-30 00:00:00.000000000 Z
11
+ date: 2018-05-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -136,6 +136,40 @@ dependencies:
136
136
  - - "~>"
137
137
  - !ruby/object:Gem::Version
138
138
  version: 0.0.2
139
+ - !ruby/object:Gem::Dependency
140
+ name: thor
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - "~>"
144
+ - !ruby/object:Gem::Version
145
+ version: '0.20'
146
+ type: :runtime
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - "~>"
151
+ - !ruby/object:Gem::Version
152
+ version: '0.20'
153
+ - !ruby/object:Gem::Dependency
154
+ name: paint
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - "~>"
158
+ - !ruby/object:Gem::Version
159
+ version: '2.0'
160
+ - - ">="
161
+ - !ruby/object:Gem::Version
162
+ version: 2.0.1
163
+ type: :runtime
164
+ prerelease: false
165
+ version_requirements: !ruby/object:Gem::Requirement
166
+ requirements:
167
+ - - "~>"
168
+ - !ruby/object:Gem::Version
169
+ version: '2.0'
170
+ - - ">="
171
+ - !ruby/object:Gem::Version
172
+ version: 2.0.1
139
173
  description:
140
174
  email:
141
175
  - florin@floringorgan.com
@@ -148,6 +182,7 @@ files:
148
182
  - LICENSE.md
149
183
  - README.md
150
184
  - lib/acv2lrtemplate.rb
185
+ - lib/acv2lrtemplate/cli.rb
151
186
  - lib/acv2lrtemplate/errors.rb
152
187
  - lib/acv2lrtemplate/errors/base.rb
153
188
  - lib/acv2lrtemplate/errors/exporter/curves_data_invalid.rb
@@ -162,7 +197,7 @@ files:
162
197
  - lib/acv2lrtemplate/validator.rb
163
198
  - lib/core_ext/object.rb
164
199
  - lib/core_ext/string.rb
165
- homepage: https://github.com/laurentzziu/permitted_attributes
200
+ homepage: https://github.com/laurentzziu/acv2lrtemplate
166
201
  licenses:
167
202
  - MIT
168
203
  metadata: {}