Commit adbcd8fd authored by f's avatar f
Browse files

sutty-cli theme generates a new theme

parents
/.bundle/
/.yardoc
/_yardoc/
/coverage/
/doc/
/pkg/
/spec/reports/
/tmp/
# rspec failure tracking
.rspec_status
--format documentation
--color
--require spec_helper
---
language: ruby
cache: bundler
rvm:
- 2.6.6
before_install: gem install bundler -v 2.1.4
source "https://rubygems.org"
# Specify your gem's dependencies in sutty-cli.gemspec
gemspec
gem "rake", "~> 12.0"
gem "rspec", "~> 3.0"
Copyright (c) 2019 Sutty
The following license is modified from the MIT license and downloaded
from <https://github.com/Laurelai/anti-fascist-mit-license> on
2019-07-11.
Anti-Fascist MIT License:
The following conditions must be met by any person obtaining a copy of
this software:
- You MAY NOT be a fascist.
- You MUST not financially support fascists.
- You MUST not intentionally provide or knowingly provide through
inaction a platform for fascists to spread propaganda or organize.
- You MUST not publicly voice support for fascists.
- You MAY NOT be a member of any fascist organization, even if you are a
member to infiltrate for anti-fascist purposes.
"Fascist" can be understood as any group or individual who promotes the
political ideology of fascism.
"Fascism" can be broken down into 11 ideological features as well as 8
tactics that can form a fascist system in varying combinations, for the
sake of simplicity and brevity the individual or organization in
question must match to at least 5 features or tactics or a combination
of the two determined by the individual licencer.
Said licencer may provide a list if an individual or group matches to at
least 5 features upon request from the individual or group in question.
The ideological features are listed below.
1. Hyper-nationalism.
As defined as "The belief in the superiority of one's nation and of the
paramount importance of advancing it."
2. Militarism.
As defined as "Advocating for an increase in military forces beyond what
the real defense of a nation needs, more influence of the military upon
the policies of the civilian government, and a preference for force as a
solution over diplomacy for problems."
3. Glorification of violence and readiness to use it in politics.
As defined as "The belief that violence can be used to cleanse a
tarnished nation, also by using violence to harm, intimidate or kill
political oppoenents."
4. Fetishization of youth.
As defined as "Extolling the virtues of youth and making a special
appeal to young people to join a cause or organization"
5. Fetishization of masculinity.
As defined as "Extolling the virtues of male authority or patriarchy and
making a special appeal to men to be leaders of households and groups"
6. Leader cult.
As defined as "Creating an idealized, heroic, and worshipful image of a
leader, often through unquestioning flattery and praise."
7. Lost-golden-age syndrome.
As defined as "Creating or promoting the idea that a nation had a lost
or stolen golden age in the past that must be returned to"
8. Self-definition by opposition.
As defined as "Creating or promoting the idea that the group or
individual is the only person or way who can fight real or imagined
evils within a society."
9. Mass mobilization and mass party.
As defined as "Creating or promoting the creation of a populist group or
party for the advancment of fascist tactics or features."
10. Hierarchical party structure and tendency to purge the disloyal.
As defined as "Removal of membership from a group for lacking absolute
loyalty or lacking further usefulness to the group. Also having a
hierarchical structure within the group itself."
11. Theatricality.
As defined as "Using spectacle to gain and keep the attention of those
inside and outside of the group using speeches full of absolutes and or
superlatives. Elaborate collective rituals (rallies) meant to reenforce
loyalty within the group."
Fascist tactics include
1) Persecution of national minorities.
2) Persecution of racial minorities.
3) Persecution of religious minorities (Anti-Semitism, Islamophobia and others).
4) Promotion of a type of national purity.
5) Promotion of a state run by ideologically oriented corporate bodies.
6) Persecution of gender or sexual minorities.
7) Persecution of the disabled.
8) Formation of extra-legal forces (brownshirts) to defend fascist values.
Special criteria: Meeting only one point of the special criteria is
enough to consider someone or a group to be fascist for the purposes of
this licence.
1. Promotion of any theories that state members of the jewish ethnicity
or faith control or largely control the world, finance, or other
global major power system.
2. Denial of the holocaust or any other historically proven genocide.
3. Promotion of ethnostates.
4. Advocating for eugenics. Either positive or negative eugenics.
Promotion for the rights of abortion are not considered eugenics.
5. Advocating for the removal of rights or legal protections from a
class or group of people.
Former fascists: People or organizations who used to promote the
political ideology of fascism but no longer do so must meet the
following criterea to be able to use this software.
1. Publicly disavow past fascist deeds and ideologies.
2. Expose any and all known fascists former allies to the public.
A suggested route would be through the one peoples project
(onepeoplesproject.com). If they can confirm you have done so that
will count as meeting condition two.
3. Publicly destroy any and all fascist paraphenelia you have in your
posession including removal of tattoos and body markings
affiliated with fascist groups or gangs.
ANTI-FASCIST-MIT LICENSE:
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
The above licence agreement conditions are met in full.
The Anti-Fascist MIT License may only be used under the terms of the
Anti-Fascist MIT License.
Any modified versions of this software must also include the
Anti-Fascist MIT Licence.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# Sutty CLI
Tools to ease Sutty's themes and plugins development.
## Installation
Add this line to your application's Gemfile:
```ruby
gem 'sutty-cli'
```
And then execute:
$ bundle install
Or install it yourself as:
$ gem install sutty-cli
## Usage
```bash
sutty-cli help
```
## Development
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.
To install this gem onto your local machine, run `bundle exec rake
install`. To release a new version, update the version number in
`version.rb`, and then run `bundle exec rake release`, which will create
a git tag for the version, push git commits and tags, and push the
`.gem` file to [rubygems.org](https://rubygems.org).
## Contributing
Bug reports and pull requests are welcome on 0xacab at
https://0xacab.org/sutty/sutty-cli. This project is intended to be
a safe, welcoming space for collaboration, and contributors are expected
to adhere to the [Sutty code of
conduct](https://sutty.nl/en/code-of-conduct/).
If you like our work, [please consider
donating](https://donaciones.sutty.nl/en/)!
## Code of Conduct
Everyone interacting in the sutty-cli project’s codebases,
issue trackers, chat rooms and mailing lists is expected to follow the
[code of conduct](https://sutty.nl/en/code-of-conduct/).
## Copyright
The gem is available as free software under the terms of the MIT Antifa
License.
require "bundler/gem_tasks"
require "rspec/core/rake_task"
RSpec::Core::RakeTask.new(:spec)
task :default => :spec
#!/usr/bin/env ruby
require "bundler/setup"
require "sutty/cli"
# You can add fixtures and/or initialization code here to make experimenting
# with your gem easier. You can also use a different console, if you like.
# (If you use this, don't forget to add pry to your Gemfile!)
# require "pry"
# Pry.start
require "irb"
IRB.start(__FILE__)
#!/usr/bin/env bash
set -euo pipefail
IFS=$'\n\t'
set -vx
bundle install
# Do any other automated setup that you need to do here
#!/usr/bin/env ruby
# frozen_string_literal: true
lib_path = File.expand_path('../lib', __dir__)
$:.unshift(lib_path) if !$:.include?(lib_path)
require 'sutty/cli/cli'
Signal.trap('INT') do
warn("\n#{caller.join("\n")}: interrupted")
exit(1)
end
begin
Sutty::Cli::CLI.start
rescue Sutty::Cli::CLI::Error => err
puts "ERROR: #{err.message}"
exit 1
end
require "sutty/cli/version"
module Sutty
module Cli
class Error < StandardError; end
# Your code goes here...
end
end
# frozen_string_literal: true
require 'thor'
module Sutty
module Cli
# Handle the application command line parsing
# and the dispatch to various command objects
#
# @api public
class CLI < Thor
# Error raised by this runner
Error = Class.new(StandardError)
desc 'version', 'sutty-cli version'
def version
require_relative 'version'
puts "v#{Sutty::Cli::VERSION}"
end
map %w(--version -v) => :version
desc 'theme NAME', 'Start a new theme'
method_option :help, aliases: '-h', type: :boolean,
desc: 'Display usage information'
def theme(name)
if options[:help]
invoke :help, ['theme']
else
require_relative 'commands/theme'
Sutty::Cli::Commands::Theme.new(name, options).execute
end
end
end
end
end
# frozen_string_literal: true
require 'forwardable'
module Sutty
module Cli
class Command
extend Forwardable
def_delegators :command, :run
# Execute this command
#
# @api public
def execute(*)
raise(
NotImplementedError,
"#{self.class}##{__method__} must be implemented"
)
end
# The external commands runner
#
# @see http://www.rubydoc.info/gems/tty-command
#
# @api public
def command(**options)
require 'tty-command'
TTY::Command.new(options)
end
# The cursor movement
#
# @see http://www.rubydoc.info/gems/tty-cursor
#
# @api public
def cursor
require 'tty-cursor'
TTY::Cursor
end
# Open a file or text in the user's preferred editor
#
# @see http://www.rubydoc.info/gems/tty-editor
#
# @api public
def editor
require 'tty-editor'
TTY::Editor
end
# File manipulation utility methods
#
# @see http://www.rubydoc.info/gems/tty-file
#
# @api public
def generator
require 'tty-file'
TTY::File
end
# Terminal output paging
#
# @see http://www.rubydoc.info/gems/tty-pager
#
# @api public
def pager(**options)
require 'tty-pager'
TTY::Pager.new(options)
end
# Terminal platform and OS properties
#
# @see http://www.rubydoc.info/gems/tty-pager
#
# @api public
def platform
require 'tty-platform'
TTY::Platform.new
end
# The interactive prompt
#
# @see http://www.rubydoc.info/gems/tty-prompt
#
# @api public
def prompt(**options)
require 'tty-prompt'
TTY::Prompt.new(options)
end
# Get terminal screen properties
#
# @see http://www.rubydoc.info/gems/tty-screen
#
# @api public
def screen
require 'tty-screen'
TTY::Screen
end
# The unix which utility
#
# @see http://www.rubydoc.info/gems/tty-which
#
# @api public
def which(*args)
require 'tty-which'
TTY::Which.which(*args)
end
# Check if executable exists
#
# @see http://www.rubydoc.info/gems/tty-which
#
# @api public
def exec_exist?(*args)
require 'tty-which'
TTY::Which.exist?(*args)
end
end
end
end
# frozen_string_literal: true
require_relative '../command'
require 'tty-command'
module Sutty
module Cli
module Commands
class Theme < Sutty::Cli::Command
attr_reader :name
def initialize(name, options)
@name = name
@options = options
end
def execute(input: $stdin, output: $stdout)
cmd.run('git clone https://0xacab.org/sutty/jekyll/sutty-base-jekyll-theme.git', theme_name)
Dir.chdir theme_name do
cmd.run('git remote rename origin upstream')
cmd.run('git remote add origin', origin)
cmd.run('bundle install')
cmd.run('yarn install')
cmd.run('git mv sutty-base-jekyll-theme.gemspec', gemspec)
end
end
private
def theme_name
@theme_name ||= name + '-jekyll-theme'
end
def origin
@origin ||= 'git@0xacab.org:sutty/jekyll/' + theme_name + '.git'
end
def gemspec
@gemspec ||= theme_name + '.gemspec'
end
def cmd
@cmd ||= TTY::Command.new
end
end
end
end
end
module Sutty
module Cli
VERSION = "0.1.0"
end
end
require "bundler/setup"
require "sutty/cli"
RSpec.configure do |config|
# Enable flags like --only-failures and --next-failure
config.example_status_persistence_file_path = ".rspec_status"
# Disable RSpec exposing methods globally on `Module` and `main`
config.disable_monkey_patching!
config.expect_with :rspec do |c|
c.syntax = :expect
end
end
RSpec.describe Sutty::Cli do
it "has a version number" do
expect(Sutty::Cli::VERSION).not_to be nil
end
it "does something useful" do
expect(false).to eq(true)
end
end
require_relative 'lib/sutty/cli/version'
Gem::Specification.new do |spec|
spec.name = "sutty-cli"
spec.license = "MIT"
spec.version = Sutty::Cli::VERSION
spec.authors = ["f"]
spec.email = ["f@sutty.nl"]
spec.summary = %q{Sutty CLI Tools}
spec.description = %q{Tools to develop Sutty's themes and plugins}
spec.homepage = "https://0xacab.org/sutty/#{spec.name}"
spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
spec.metadata = {
'bug_tracker_uri' => "#{spec.homepage}/issues",
'homepage_uri' => spec.homepage,
'source_code_uri' => spec.homepage,
'changelog_uri' => "#{spec.homepage}/-/blob/master/CHANGELOG.md",
'documentation_uri' => "https://rubydoc.info/gems/#{spec.name}"
}
spec.files = Dir['lib/**/*', 'exe/*']
spec.require_paths = %w[lib]
spec.bindir = 'exe'
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
spec.extra_rdoc_files = Dir['README.md', 'CHANGELOG.md', 'LICENSE.txt']
spec.rdoc_options += [
'--title', "#{spec.name} - #{spec.summary}",
'--main', 'README.md',
'--line-numbers',
'--inline-source',
'--quiet'
]
spec.required_ruby_version = '~> 2.6'
spec.add_dependency 'tty-command', '~> 0'
spec.add_development_dependency 'pry', '~> 0'
end
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment