davinci-text 1.0.0.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.
Files changed (67) hide show
  1. checksums.yaml +7 -0
  2. data/.byebug_history +86 -0
  3. data/.circleci/config.yml +57 -0
  4. data/.gitignore +53 -0
  5. data/CODE_OF_CONDUCT.md +74 -0
  6. data/Gemfile +4 -0
  7. data/Gemfile.lock +50 -0
  8. data/LICENSE.txt +21 -0
  9. data/README.md +91 -0
  10. data/REFERENCE.md +71 -0
  11. data/Rakefile +4 -0
  12. data/bin/davinci +16 -0
  13. data/controllers/atom_input_controller.rb +146 -0
  14. data/controllers/atom_output_controller.rb +107 -0
  15. data/controllers/cl_args_controller.rb +62 -0
  16. data/controllers/menu_controller.rb +148 -0
  17. data/controllers/sublime_input_controller.rb +97 -0
  18. data/controllers/sublime_output_controller.rb +62 -0
  19. data/davinci-text.gemspec +34 -0
  20. data/example_files/atom/atom-dark-syntax/CONTRIBUTING.md +1 -0
  21. data/example_files/atom/atom-dark-syntax/ISSUE_TEMPLATE.md +40 -0
  22. data/example_files/atom/atom-dark-syntax/LICENSE.md +20 -0
  23. data/example_files/atom/atom-dark-syntax/PULL_REQUEST_TEMPLATE.md +28 -0
  24. data/example_files/atom/atom-dark-syntax/README.md +9 -0
  25. data/example_files/atom/atom-dark-syntax/index.less +7 -0
  26. data/example_files/atom/atom-dark-syntax/output.less +384 -0
  27. data/example_files/atom/atom-dark-syntax/package.json +11 -0
  28. data/example_files/atom/atom-dark-syntax/styles/editor.less +50 -0
  29. data/example_files/atom/atom-dark-syntax/styles/syntax-variables.less +44 -0
  30. data/example_files/atom/atom-dark-syntax/styles/syntax.less +283 -0
  31. data/example_files/atom/loved-syntax/CONTRIBUTING.md +1 -0
  32. data/example_files/atom/loved-syntax/LICENSE.md +20 -0
  33. data/example_files/atom/loved-syntax/README.md +14 -0
  34. data/example_files/atom/loved-syntax/index.less +18 -0
  35. data/example_files/atom/loved-syntax/output.less +648 -0
  36. data/example_files/atom/loved-syntax/package.json +15 -0
  37. data/example_files/atom/loved-syntax/styles/colors.less +44 -0
  38. data/example_files/atom/loved-syntax/styles/editor.less +96 -0
  39. data/example_files/atom/loved-syntax/styles/syntax-variables.less +56 -0
  40. data/example_files/atom/loved-syntax/styles/syntax/_base.less +311 -0
  41. data/example_files/atom/loved-syntax/styles/syntax/c.less +5 -0
  42. data/example_files/atom/loved-syntax/styles/syntax/cpp.less +5 -0
  43. data/example_files/atom/loved-syntax/styles/syntax/cs.less +5 -0
  44. data/example_files/atom/loved-syntax/styles/syntax/css.less +13 -0
  45. data/example_files/atom/loved-syntax/styles/syntax/gfm.less +9 -0
  46. data/example_files/atom/loved-syntax/styles/syntax/go.less +5 -0
  47. data/example_files/atom/loved-syntax/styles/syntax/ini.less +5 -0
  48. data/example_files/atom/loved-syntax/styles/syntax/java.less +24 -0
  49. data/example_files/atom/loved-syntax/styles/syntax/javascript.less +17 -0
  50. data/example_files/atom/loved-syntax/styles/syntax/json.less +21 -0
  51. data/example_files/atom/loved-syntax/styles/syntax/python.less +9 -0
  52. data/example_files/atom/loved-syntax/styles/syntax/ruby.less +5 -0
  53. data/example_files/sublime/material.tmTheme +1011 -0
  54. data/example_files/sublime/monokai.tmTheme +432 -0
  55. data/lib/.byebug_history +3 -0
  56. data/lib/templates/atom/.gitignore +3 -0
  57. data/lib/templates/atom/LICENSE.md +20 -0
  58. data/lib/templates/atom/README.md +5 -0
  59. data/lib/templates/atom/index.less +1 -0
  60. data/lib/templates/atom/package.json +15 -0
  61. data/lib/templates/atom/styles/base.less +307 -0
  62. data/lib/templates/atom/styles/colors.less +15 -0
  63. data/lib/templates/atom/styles/syntax-variables.less +31 -0
  64. data/lib/templates/sublime/newTheme.tmTheme +438 -0
  65. data/lib/utility.rb +21 -0
  66. data/lib/version.rb +3 -0
  67. metadata +209 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 2f30467eb252d09c694b12f81f2f5e159ffb8b3a
4
+ data.tar.gz: 6d3a5c029b2383ed11a6acd61d1aba04c67615ab
5
+ SHA512:
6
+ metadata.gz: b29ffa23610dfc406a8fbcc37044410664d76f36426cd7f2b4f15226704283530b2f41cb8224a64585b2bd2aa0177b32a15041466a2b3b5f0dc527ac53e0eb67
7
+ data.tar.gz: 22721d4f906a539380943fc6e719364ad5ca61486d89a75e6c9621734037002282127ef73c06f18761b376ee5f9c31cacbfed97bc1984b5ea198c8396b9e3a0d
@@ -0,0 +1,86 @@
1
+ continue
2
+ pp @material_controller.options
3
+ @material_controller.options
4
+ @material_controller.options[:comment_foreground]
5
+ @material_controller.options[:comment_foregroun]
6
+ exit
7
+ continue
8
+ exit
9
+ continue
10
+ setting.xpath('./string[position()=1]/text()').text
11
+ setting.xpath('./dict/key[text()="foreground"]/following-sibling::string[1]/text()').text
12
+ setting[name]
13
+ setting["name"]
14
+ setting.text
15
+ setting[0]
16
+ setting
17
+ @options
18
+ continue
19
+ all_settings
20
+ continue
21
+ pp all_settings
22
+ all_settings
23
+ @input_controller.options
24
+ continue
25
+ @options
26
+ continue
27
+ @options
28
+ continue
29
+ key
30
+ continue
31
+ key = key.split(",")
32
+ key
33
+ continue
34
+ @options
35
+ key.gsub(/\s/, "")
36
+ key.gsub/\s/, "")
37
+ key
38
+ continue
39
+ key
40
+ continue
41
+ key
42
+ continue
43
+ key
44
+ continue
45
+ key
46
+ continue
47
+ key
48
+ continue
49
+ key
50
+ continue
51
+ key
52
+ continue
53
+ settings_keys
54
+ continue
55
+ settings_values
56
+ settings_keys
57
+ continue
58
+ @filepath
59
+ continue
60
+ @base
61
+ continue
62
+ @new_dir
63
+ @newdir
64
+ continue
65
+ root_dir
66
+ continue
67
+ current_dir
68
+ continue
69
+ @directory
70
+ @filepath
71
+ @new_dir
72
+ root_dir
73
+ continue
74
+ new_dir
75
+ current_dir
76
+ continue
77
+ root_dir
78
+ new_dir
79
+ continue
80
+ filepath
81
+ continue
82
+ filepath.split("/")[0..-4]
83
+ filepath[0..-4]
84
+ filepath.split("/")
85
+ filepath
86
+ script_directory
@@ -0,0 +1,57 @@
1
+ # Ruby CircleCI 2.0 configuration file
2
+ #
3
+ # Check https://circleci.com/docs/2.0/language-ruby/ for more details
4
+ #
5
+ version: 2
6
+ jobs:
7
+ build:
8
+ docker:
9
+ # specify the version you desire here
10
+ - image: circleci/ruby:2.4.1-node-browsers
11
+
12
+ # Specify service dependencies here if necessary
13
+ # CircleCI maintains a library of pre-built images
14
+ # documented at https://circleci.com/docs/2.0/circleci-images/
15
+ # - image: circleci/postgres:9.4
16
+
17
+ working_directory: ~/repo
18
+
19
+ steps:
20
+ - checkout
21
+
22
+ # Download and cache dependencies
23
+ - restore_cache:
24
+ keys:
25
+ - v1-dependencies-{{ checksum "Gemfile.lock" }}
26
+ # fallback to using the latest cache if no exact match is found
27
+ - v1-dependencies-
28
+
29
+ - run:
30
+ name: install dependencies
31
+ command: |
32
+ bundle install --jobs=4 --retry=3 --path vendor/bundle
33
+
34
+ - save_cache:
35
+ paths:
36
+ - ./venv
37
+ key: v1-dependencies-{{ checksum "Gemfile.lock" }}
38
+
39
+ # Database setup
40
+ # - run: bundle exec rake db:create
41
+ # - run: bundle exec rake db:schema:load
42
+
43
+ # run tests!
44
+ - run:
45
+ name: run tests
46
+ command: |
47
+ mkdir /tmp/test-results
48
+ TEST_FILES="$(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings)"
49
+
50
+ bundle exec rspec
51
+
52
+ # collect reports
53
+ - store_test_results:
54
+ path: /tmp/test-results
55
+ - store_artifacts:
56
+ path: /tmp/test-results
57
+ destination: test-results
@@ -0,0 +1,53 @@
1
+ *.gem
2
+ *.rbc
3
+ /.config
4
+ /coverage/
5
+ /InstalledFiles
6
+ /pkg/
7
+ /spec/reports/
8
+ /spec/examples.txt
9
+ /test/tmp/
10
+ /test/version_tmp/
11
+ /tmp/
12
+
13
+ output/*
14
+ !output/.gitkeep
15
+
16
+ # Used by dotenv library to load environment variables.
17
+ # .env
18
+
19
+ ## Specific to RubyMotion:
20
+ .dat*
21
+ .repl_history
22
+ build/
23
+ *.bridgesupport
24
+ build-iPhoneOS/
25
+ build-iPhoneSimulator/
26
+
27
+ ## Specific to RubyMotion (use of CocoaPods):
28
+ #
29
+ # We recommend against adding the Pods directory to your .gitignore. However
30
+ # you should judge for yourself, the pros and cons are mentioned at:
31
+ # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
32
+ #
33
+ # vendor/Pods/
34
+
35
+ ## Documentation cache and generated files:
36
+ /.yardoc/
37
+ /_yardoc/
38
+ /doc/
39
+ /rdoc/
40
+
41
+ ## Environment normalization:
42
+ /.bundle/
43
+ /vendor/bundle
44
+ /lib/bundler/man/
45
+
46
+ # for a library or gem, you might want to ignore these files since the code is
47
+ # intended to run in multiple environments; otherwise, check them in:
48
+ # Gemfile.lock
49
+ # .ruby-version
50
+ # .ruby-gemset
51
+
52
+ # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
53
+ .rvmrc
@@ -0,0 +1,74 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as
6
+ contributors and maintainers pledge to making participation in our project and
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, gender identity and expression, level of experience,
9
+ nationality, personal appearance, race, religion, or sexual identity and
10
+ orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to creating a positive environment
15
+ include:
16
+
17
+ * Using welcoming and inclusive language
18
+ * Being respectful of differing viewpoints and experiences
19
+ * Gracefully accepting constructive criticism
20
+ * Focusing on what is best for the community
21
+ * Showing empathy towards other community members
22
+
23
+ Examples of unacceptable behavior by participants include:
24
+
25
+ * The use of sexualized language or imagery and unwelcome sexual attention or
26
+ advances
27
+ * Trolling, insulting/derogatory comments, and personal or political attacks
28
+ * Public or private harassment
29
+ * Publishing others' private information, such as a physical or electronic
30
+ address, without explicit permission
31
+ * Other conduct which could reasonably be considered inappropriate in a
32
+ professional setting
33
+
34
+ ## Our Responsibilities
35
+
36
+ Project maintainers are responsible for clarifying the standards of acceptable
37
+ behavior and are expected to take appropriate and fair corrective action in
38
+ response to any instances of unacceptable behavior.
39
+
40
+ Project maintainers have the right and responsibility to remove, edit, or
41
+ reject comments, commits, code, wiki edits, issues, and other contributions
42
+ that are not aligned to this Code of Conduct, or to ban temporarily or
43
+ permanently any contributor for other behaviors that they deem inappropriate,
44
+ threatening, offensive, or harmful.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies both within project spaces and in public spaces
49
+ when an individual is representing the project or its community. Examples of
50
+ representing a project or community include using an official project e-mail
51
+ address, posting via an official social media account, or acting as an appointed
52
+ representative at an online or offline event. Representation of a project may be
53
+ further defined and clarified by project maintainers.
54
+
55
+ ## Enforcement
56
+
57
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
+ reported by contacting the project team at matt.cheah@gmail.com. All
59
+ complaints will be reviewed and investigated and will result in a response that
60
+ is deemed necessary and appropriate to the circumstances. The project team is
61
+ obligated to maintain confidentiality with regard to the reporter of an incident.
62
+ Further details of specific enforcement policies may be posted separately.
63
+
64
+ Project maintainers who do not follow or enforce the Code of Conduct in good
65
+ faith may face temporary or permanent repercussions as determined by other
66
+ members of the project's leadership.
67
+
68
+ ## Attribution
69
+
70
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
+ available at [http://contributor-covenant.org/version/1/4][version]
72
+
73
+ [homepage]: http://contributor-covenant.org
74
+ [version]: http://contributor-covenant.org/version/1/4/
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
4
+
@@ -0,0 +1,50 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ davinci-text (1.0.0)
5
+ coyote (~> 1.2)
6
+ nokogiri (~> 1.8)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ byebug (9.0.6)
12
+ colored (1.2)
13
+ coyote (1.2.0)
14
+ colored (>= 1.2)
15
+ rb-fsevent (>= 0.4.0)
16
+ diff-lcs (1.3)
17
+ mini_portile2 (2.2.0)
18
+ nokogiri (1.8.0)
19
+ mini_portile2 (~> 2.2.0)
20
+ rake (10.4.2)
21
+ rb-fsevent (0.10.2)
22
+ rspec (3.6.0)
23
+ rspec-core (~> 3.6.0)
24
+ rspec-expectations (~> 3.6.0)
25
+ rspec-mocks (~> 3.6.0)
26
+ rspec-core (3.6.0)
27
+ rspec-support (~> 3.6.0)
28
+ rspec-expectations (3.6.0)
29
+ diff-lcs (>= 1.2.0, < 2.0)
30
+ rspec-support (~> 3.6.0)
31
+ rspec-mocks (3.6.0)
32
+ diff-lcs (>= 1.2.0, < 2.0)
33
+ rspec-support (~> 3.6.0)
34
+ rspec-support (3.6.0)
35
+ rspec_junit_formatter (0.3.0)
36
+ rspec-core (>= 2, < 4, != 2.12.0)
37
+
38
+ PLATFORMS
39
+ ruby
40
+
41
+ DEPENDENCIES
42
+ bundler (~> 1.15)
43
+ byebug (~> 9.0)
44
+ davinci-text!
45
+ rake (~> 10.0)
46
+ rspec (~> 3.2)
47
+ rspec_junit_formatter (~> 0.3)
48
+
49
+ BUNDLED WITH
50
+ 1.15.4
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2017 Matt Cheah
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,91 @@
1
+ # DaVinci-Text
2
+
3
+ ![alt text](https://circleci.com/gh/mattcheah/davinci.svg?style=shield&circle-token=5a1e0343c196170c3abe3387d7014657fef4b700 "")
4
+
5
+ Ruby command-line script to transfer your text-editor color scheme between the Sublime and Atom text editors.
6
+
7
+ Support for Dreamweaver and Brackets to come.
8
+
9
+ ## Installation / Setup
10
+
11
+ Install the gem the normal way:
12
+
13
+ $ gem install davinci
14
+
15
+ You are now ready to use Davinci.
16
+
17
+ ## Usage
18
+
19
+ ### Command Line Interface
20
+
21
+ After instaling davinci, run it by simply typing `davinci` in the command line and follow the instructions.
22
+ A command line prompt will show, asking you to choose the text editor you want to transfer your theme from.
23
+
24
+ What Text Editor are you currently using?
25
+ (1) Sublime
26
+ (2) Atom
27
+ > 1
28
+
29
+ Enter 1 or 2 to select your text editor. The system will then ask for the theme file or theme folder.
30
+ To figure out where this is, see the [Reference section](https://github.com/mattcheah/davinci/blob/master/REFERENCE.md).
31
+ You may also use the example_files directory, which contains the default Atom theme "Atom-Dark-Syntax", and the default Sublime theme "Monokai".
32
+
33
+ Enter the full filepath of your Sublime tmTheme syntax color file.
34
+ If you do not know where this can be found, please read the documentation.
35
+ > /example_files/sublime/monokai.tmTheme
36
+
37
+ Enter the path to your theme file or directory. Then give the output text editor to finish things up.
38
+
39
+ What editor would you like to move your color scheme to?
40
+ (1) Sublime
41
+ (2) Atom
42
+ > 2
43
+
44
+ The system will output the parsed options into a theme template for your output text editor and place the file(s) into a folder nested in the original filepath.
45
+ To add this newly created theme to your text editor, read the [Reference section](https://github.com/mattcheah/davinci/blob/master/REFERENCE.md).
46
+
47
+ To exit the program any time, press ctrl+c
48
+
49
+ ### One Line Execution
50
+
51
+ If you don't want to go through the command line interface, simply provide arguments for your filepath (sublime) or directory path (atom), and the name of your output editor ("sublime" or "atom").
52
+
53
+ `davinci example_files/sublime/monokai.tmTheme atom`
54
+
55
+ or
56
+
57
+ `davinci example_files/atom/atom-dark-syntax sublime`
58
+
59
+ ## Warnings
60
+
61
+ Theme files are parsed by an XML Parser or by Regex. Both of these parsing methods can be potentially unreliable depending on the scopes assigned to the colors in the Sublime XML file, or the combination of Less selectors in the Atom combined file.
62
+
63
+ This is further complicated by the fact that editors do not always categorize the same code in the same way. As an example, the `System` in the following Java code
64
+
65
+ System.out.println("Hello World!");
66
+
67
+ is categorized in Sublime as a "Storage Type" keyword, usually reserved for keywords that affect the storage of an item (eg. `void` in Java). However, in Atom, `System` is given the classes `"syntax--variable syntax--other syntax--object syntax--java"`. The most common of these classes would be `syntax--variable`, meaning that even if colors from other classes are parsed (they're not), the color would not necessarily show up the same when transferring between Atom and Sublime.
68
+
69
+ All this to say that the process is unstable and you may have to do a little bit of clean-up work on your resulting theme-files. I have found, however, that the overall look and feel of the theme is preserved.
70
+
71
+ ## Contributing
72
+
73
+ Bug reports and pull requests are welcome on GitHub at https://github.com/mattcheah/davinci. 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.
74
+
75
+ ### Support for new editors
76
+
77
+ Contributors who would like to add support for a new editor should make sure their pull requests contain the following:
78
+ * An Excel or CSV file adding a selector column for their new editor to the [reference sheet](https://docs.google.com/spreadsheets/d/1DqhOP7L2ApQSOU6tKnh1Bx-92pzY7-BJK2Yccf6wr-c/edit?usp=sharing).
79
+ * A controller for inputting and/or outputting hex codes to/from the options hash.
80
+ * Rspec tests
81
+ * Input Controllers: Tests should confirm that an options hash contains the correct colors for the primary theme styles (:foreground, :background, :comment_foreground, :string_foreground, etc)
82
+ * Output Controllers: Tests should confirm that the colors from a given options hash show up correctly in the outputted file(s). If an input controller is provided, it can be used to confirm this. If not, the outputted file must be parsed manually.
83
+ * Updates to MenuController and cl_args_controller to include functionality.
84
+
85
+ ## License
86
+
87
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
88
+
89
+ ## Code of Conduct
90
+
91
+ Everyone interacting in the davinci project’s codebases is expected to follow the [code of conduct](https://github.com/mattcheah/davinci/blob/master/CODE_OF_CONDUCT.md).