Project

act

0.02
No commit activity in last 3 years
No release in over 3 years
Act, the command line tool to act on files.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.5
>= 0

Runtime

~> 0.5
~> 1.2
~> 1.7
 Project Readme

Act

Build Status

Preview files from the command line efficiently. cat for the twenty first century!

Features

  • Flexible input handling
    • Support for colon syntax
    • Support for GitHub like URLs
  • Automatic syntax highlighting based on the file extension (via Pygments)
  • Fast enough for the task

Installation

$ [sudo] gem install act
$ [sudo] easy_install Pygments #optional

Help needed

Follow @fabiopelosin to help me beat @orta in followers count.

Usage

Print a complete file:

$ act lib/act/command.rb

0    require 'colored'
1    require 'claide'
2    require 'active_support/core_ext/string/strip'
[...]

Print the line 10 with the default context (5 lines):

$ act lib/act/command.rb:10

5    module Act
6      class Command < CLAide::Command
7
8        self.command = 'act'
9        self.description = 'Act the command line tool to act on files'
10
11       def self.options
12         [
13           ['--open', "Open the file in $EDITOR instead of printing it"],
14           ['--no-line-numbers', "Show output without line numbers"],
15           ['--version', 'Show the version of Act'],

Open in $EDITOR the file at the given line:

$ act lib/act/command.rb:10 --open

Print from line 8 to line 12:

$ act lib/act/command.rb:8-12

8    self.command = 'act'
9    self.description = 'Act the command line tool to act on files'
10
11   def self.options
12     [

Print from line 10 with 2 lines of context:

$ act lib/act/command.rb:10+2

8    self.command = 'act'
9    self.description = 'Act the command line tool to act on files'
10
11   def self.options
12     [

Show ./lib/act/command.rb from line 8 to line 9:

$ act https://github.com/irrationalfab/act/blob/master/lib/act/command.rb\#L8-L9

8    self.command = 'act'
9    self.description = 'Act the command line tool to act on files'

Open $EDITOR ./lib/act/command.rb at line 8:

$ act https://github.com/irrationalfab/act/blob/master/lib/act/command.rb\#L8-L9